Compare elements of two matrices

1 次查看(过去 30 天)
The necessary condition for my "while" loop to keep running is that not all elements of matrix B are smaller than those of matrix A, that is, for the loop to stop it must be true that:
B(i,j) < A(i,j)
for all i and all j. I can compare the two matrices like
C = (B < A)
and get a matrix with 0 and 1 elements, but then the problem converts to checking whether all elements of the matrix C are 1 or not. Is there a way to solve this without using for loops inside the while loop to compare the elements one by one?
Thank you in advance and sorry for my English.

采纳的回答

Andrei Bobrov
Andrei Bobrov 2012-2-13

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Loops and Conditional Statements 的更多信息

产品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by