简体   繁体   中英

How to write conditional statement for a parameter between 2 values in MATLAB

I have a parameter d (distance):

20 <= d < 60

[if d between greater than or equal 20 , and less 60]

I'd like to know to represent this in matlab?

Simply:

if d>=20 && d<60
   %body
end

If d is a vector you can use & instead of &&

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM