if with 2 conditions
16 次查看(过去 30 天)
显示 更早的评论
i used this statement conditions before it worked well,
but this time Matlab says it work with logic condition only:
how to recover ?
thanks
0 个评论
回答(1 个)
Image Analyst
2021-9-19
What does this say
whos Ree
It's probably a vector, not a scalar.
2 个评论
Image Analyst
2021-9-19
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.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Logical 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!