bsxfun with AND condition
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
AA
am 15 Nov. 2016
Kommentiert: James Tursa
am 4 Feb. 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 Kommentare
Akzeptierte Antwort
James Tursa
am 15 Nov. 2016
Bearbeitet: James Tursa
am 15 Nov. 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 Kommentare
Weitere Antworten (1)
AA
am 3 Feb. 2017
1 Kommentar
James Tursa
am 4 Feb. 2017
Please post your code so we know what "... doesn't work ..." means to you.
Siehe auch
Kategorien
Mehr zu Logical finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!