bsxfun with AND condition
1 回表示 (過去 30 日間)
古いコメントを表示
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 件のコメント
採用された回答
James Tursa
2016 年 11 月 15 日
編集済み: James Tursa
2016 年 11 月 15 日
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 件のコメント
その他の回答 (1 件)
AA
2017 年 2 月 3 日
1 件のコメント
James Tursa
2017 年 2 月 4 日
Please post your code so we know what "... doesn't work ..." means to you.
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!