bsxfun with AND condition
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
AA
el 15 de Nov. de 2016
Comentada: James Tursa
el 4 de Feb. de 2017
How can I use a code to see if compare1<q{x,y}<compare2
Basically the lt/gt function combined with an and function?
bsxfun(@lt,q{x,y},compare2 & q{x,y},compare1);
0 comentarios
Respuesta aceptada
James Tursa
el 15 de Nov. de 2016
Editada: James Tursa
el 15 de Nov. de 2016
Assuming q{x,y} and compare# are different sizes and need bsxfun, just & the two separate calculations:
result = bsxfun(@lt,compare1,q{x,y}) & bsxfun(@lt,q{x,y},compare2);
For R2016b you would not need bsxfun for this at all but could code the < operations directly.
0 comentarios
Más respuestas (1)
AA
el 3 de Feb. de 2017
1 comentario
James Tursa
el 4 de Feb. de 2017
Please post your code so we know what "... doesn't work ..." means to you.
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!