hi,
I want to use a while loop on matrices, to define a new matrix by calculating one row each time.
I'm trying to do it without creating another loop that will go over the columns. Is that possible?
for example:
z5 and k5 are known matrices. This loop defines c5.
i=1;while i<imax if z5(i,:) < z5(i-1,:) c5(i,:) = k5(i,:); elseif z5(i,:) > z5(i-1,:) c5(i,:) = z5(i,:); else c5(i,:) = c5(i-1,:); end i=i+1;end
It's not doing what I want it to do and I'm not sure what exactly its doing.
Would appreciate any help and clarification on this matter.
Best Answer