How to compare two vectors with different dimensions to get logical array?
Mostrar comentarios más antiguos
Hello, I have two vectors with different dimensions. To make it simple,lets say A=[775.4; 770.2; 690;...] is n by 1 and B is m by 2: for example, B(1,:)=775.446,774.706. Basically, I want this: if A(i,1)<=B(i,1) & A(i,1)>=B(i,2) is true,then do sth. i tried to use for statement such as for i=size(A),obviously, theres problem because of the two dimensions. If anybody knows how to solve this problem, please let me know. Thanks.
3 comentarios
Sean de Wolski
el 3 de Mayo de 2012
And you want to do this for each value of A, wotjh each value of B?
Sean de Wolski
el 3 de Mayo de 2012
Please provide the expected result for your simple example.
Lei
el 3 de Mayo de 2012
Respuesta aceptada
Más respuestas (0)
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!