Solved


Count the non-zero elements along the diagonals that are immediately next to the main diagonal
Suppose, you are being told to write a matrix, *a* as input in MATLAB with having the possibility of containing zero and non-zer...

4 years ago

Solved


Determine the perimeter of a three-quarter circle
If a circle has a diameter of x as an input value, then show the value of the perimeter of the three-quarter circle in output va...

4 years ago

Solved


How many points lie within the rectangle and how many aren't?
Suppose, you are given the coordinates of bottom-left and top-right corners of a rectangle as *input-1, R* i.e *R=[Bottom-left c...

4 years ago

Answered
Error with vpa solve
Tc=fzero(@I,126); [~,Vliq,Vvs]=I(Tc); function [integralearee,Vliq,Vvs]=I(Tc) Tb=112; %K Z=0.27; R=0.0821; DH=...

4 years ago | 0

Answered
Find sequence of numbers in vector
for-loop %for loop a = round(rand(1000,1)); count=0; eidx=[]; for m=1:length(a)-1 %look at what this does a(m)==0&&a(...

4 years ago | 0

Answered
Index in position 2 exceeds array bounds. Index must not exceed 1.,,,, (error in the code of plotting), how can I fix that?
for i= 1:length(Tc) sol= []; for n= 1:length(Pr) Tr= T/Tc(i); beta= ome*Pr(n)/Tr; q= psi*al...

4 years ago | 1

| accepted

Answered
Index in position 1 is invalid. Array indices must be positive integers or logical values.
for i = 1:c [CO2removal, reboil_duty]=simulation(x,i);%need to pass i to the function as well end function [CO2removal...

4 years ago | 0

| accepted

Answered
Search for a range in a column
m=yourMatrix; t=.00001; for k=1:size(m,1) c{k}=find(m(:,2)>=m(k,1)-t&m(:,2)<=m(k,1)+t);%use cell array if there can be more...

5 years ago | 0

Answered
Function on separate intervals
t=0:.01:3;%the start and stop of t defines t0 and tf t1 = 1; t2 = 1.5; z=funz(t,t1,t2); plot(t,z); function z = funz(t,t1...

5 years ago | 0

| accepted

Answered
How to change specific numbers in a column in MATLAB?
table.month(table.month>=5&table.month<=10)=13; table.month(table.month<=4|table.month>=11)=14;

5 years ago | 0

| accepted

Answered
concatenate vector within nested structures
z=[]; for k=1:217 s=sprintf('DATA.Segment%d.data',k); z=[z;eval(s)]; end

5 years ago | 0

Answered
Location vector in matlab
ohmx=((1-mu^2))^1/2*sin(fi); ohmy=((1-mu^2))^1/2*cos(fi); ohmz=mu; ohm=[ohmx,ohmy,ohmz];%this is your vector

5 years ago | 0

| accepted

Answered
For loop in matlab
Not sure what you are trying to do. You don't use several variables. Why use symbolic? n=10^6; R=0.30; l=0.1; d=0.05; fo...

5 years ago | 0

| accepted

Answered
what does the "oldx =[x(n);oldx(1:256)]" in the following programm do?
for n = 1: 256000 oldx =[x(n);oldx(1:255)];%just reforming the oldx array with x(n) on top and then the next 255 elements of ...

5 years ago | 0

| accepted

Answered
Count rows in a table that contain specific letters
nnz(contains(companyNamesJoiner.company,'DEAD - DELIST'));

5 years ago | 0

| accepted

Answered
summations and selections of the columns of a matrix
newMatrix=[yourMatrix(1,:);flipud(cumsum(flipud(yourMatrix(2:end,:))))];

5 years ago | 0

| accepted

Answered
How can i solve this problem
Show me what you have tried for the C(k) equation above. function C= FourierSeries(x,MaxK) N=length(x); n=0:N-1; for k=1:2*M...

5 years ago | 0

Answered
I am unsure of how I am getting this error
r=linspace(0.001,1,1000); s=0.75*((r.^3)./(exp(1).^(.75*r)));%error is here (multiplying by scalar does not need .*, but you ne...

5 years ago | 0

Answered
make a matrix of values from questions from another matrix
qo = 2*[1,0,1,0]; set(0, 'DefaultUIControlFontSize', 20); LoadType=ones(size(qo)); for k=find(qo) LoadType(k) = menu...

5 years ago | 0

| accepted

Answered
For loop and matrices w/ different elements?
B(i)=[m2.*A2x(i); m2.*A2y(i); I2*a2; m3*A3x(i); m3*A3y(i); I3*a3(i); m4*A4x(i)-F4x(i); 0];%ne...

5 years ago | 0

| accepted

Answered
How to code with for loop loops without using ndgrid?
count=0; for c=5:6 for b=3:4 for a=1:2 count=count+1; d(count,:)=[a,b,c]; end ...

5 years ago | 1

Answered
How to divide a vector into small groups
x=randi(100,30,1); X=reshape(x,2,[]); [~,idxGroup]=find(X==x(15));

5 years ago | 0

| accepted

Answered
Extracting the sub-matrix
A = [1 2 3; 4 5 6; 7 8 9]; B=A(1:2,2:3); E=blkdiag(zeros(2),A);

5 years ago | 1

| accepted

Solved


Find the index of nth maximum of a row vector of real numbers
Given a vector of real numbers x, find the index idx of _n_ th maximum value. If nth maximum occurs more than once, return the i...

5 years ago

Solved


Add consecutive integer numbers
Given consecutive numbers, add the numbers *without using the sum command in MATLAB.*

5 years ago

Answered
plotting a 2-colum 2d array
plot(a(:,1),a(:,2));

5 years ago | 1

Answered
Not enough Input arguments in integral function
s=0:100; for t=1:numel(s) fun_W=@(k)real(c_k(k))./k.*sin(k*s(t)); W(t)=2/pi*integral(fun_W,0,Inf); end fu...

5 years ago | 1

| accepted

Solved


Find hen's weight.
If hen weights x kilos on two legs, how much does it weights on one leg? Output the result.

5 years ago

Solved


Count given word x in text.
Count how many times given word x repeats in text.

5 years ago

Solved


Opposite task convert string hexadecimal numbers array into array of decimal numbers .
Opposite task convert string hexadecimal numbers array into array of decimal numbers . Example x=[ '208'; '209'; '20A'; ...

5 years ago

Load more