Hi, I am trying to write a code with nested for loop and if statement. I want to create a matrix in such way that, for one value of y, I have different values of x and z, and again for another value of y, I have same values for x but different values of z.
load a.dat;x=a(:,1);y=a(:,2); z=a(:,3); for j=min(y):1:max(y) for i=1:10 if j=10 A(:,i)=z(i) else if j=j+1 endendendI am not able to apply if statement for y.Could anyone please help me?
Best Answer