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);

 Réponse acceptée

James Tursa
James Tursa le 15 Nov 2016
Modifié(e) : James Tursa le 15 Nov 2016

0 votes

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.

Plus de réponses (1)

AA
AA le 3 Fév 2017

0 votes

no it doesnt work. it gives me one set that is less than compare 2 and another set that is less than compare 1. after that it combines these two sets.
I need compare1<q{x,y}<compare2

1 commentaire

James Tursa
James Tursa le 4 Fév 2017
Please post your code so we know what "... doesn't work ..." means to you.

Connectez-vous pour commenter.

Catégories

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by