If-statement, comparison of two vectors, both containing zero elements
Mostrar comentarios más antiguos
Hi there, I want to compare two vectors that both contain elements equal to 0 in an if statement (so if vec1 < vec2) for example. This leads Matlab to skip the whole if loop, does anyone have an idea to solve this? Both vectors have the same length
vec1 = [1 0 3 6 43 56];
vec2 = [2 9 5 0 23 43];
if vec1 < vec2
disp('it works');
else
disp('it doesnt');
end
How can I solve this?
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Discrete Events and Mode Charts 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!