if with 2 conditions

i used this statement conditions before it worked well,
but this time Matlab says it work with logic condition only:
how to recover ?
thanks

Answers (1)

What does this say
whos Ree
It's probably a vector, not a scalar.

2 Comments

yes you have write , i must make a loop i forgot that .
i hope for a scalar it does work.
thanks
You might want to use any or all():
if any(Ree > 100000 & Ree < 1000000) % Check if any of them is in range.
if all(Ree > 100000 & Ree < 1000000) % Checks that ALL of them are in range.

Sign in to comment.

Categories

Find more on MATLAB in Help Center and File Exchange

Products

Release

R2017b

Asked:

on 19 Sep 2021

Commented:

on 19 Sep 2021

Community Treasure Hunt

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

Start Hunting!