How can I solve if condition in for loop matrix?
Mostrar comentarios más antiguos
I want to make an iteration that when the component of a matrix A has less value than the component of matrix B, it will continue the process to the next iteration.
A =
[ 2 5 9 12
6 4 13 1
3 2 19 5]
B=
[ 5
5
5]
in the first column, the condition is not met so it cannot proceed to the second column. and in the second column, conditions have been met so that it can proceed to the third column.
I tried in for loop but, the A values always stuck in first column even condition is right.
Thank you.
3 comentarios
madhan ravi
el 30 de Mayo de 2019
What is your desired result? Show it explicitly.
Dina Maulina
el 30 de Mayo de 2019
Guillaume
el 30 de Mayo de 2019
then the loop
What loop? Remember that we have no idea what you're doing. If you don't show us your code, how can we tell us how to fix it?
Most likely, whatever loop you're using is not even necessary.
Respuesta aceptada
Más respuestas (1)
KSSV
el 30 de Mayo de 2019
all(A<B,2)
Categorías
Más información sobre Loops and Conditional Statements en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!