MATLAB Answers

0

While loop for array. I want the loop stop when all element of "a" equal "b" but for this loop it will stop when only one element of a equal b. How could I fix it?

Asked by Nopparat on 2 Dec 2012
I'd like to use while loop for array.
For example, I have the first array(a) ,10x10x10, and the second array(b),10x10x10 and this following is my condition:
while a ~= b .... a statement.....
end
I want this stop when all element of "a" equal "b" but for this loop it will stop when only one element of a equal b. How could I fix this statement?
Thank you very much

  0 Comments

Sign in to comment.

1 Answer

Answer by the cyclist
on 2 Dec 2012
Edited by the cyclist
on 2 Dec 2012
 Accepted Answer

while not(isequal(a,b))

  1 Comment

Sign in to comment.