How do i do x1<=x<=x2 in matlab?
3 ビュー (過去 30 日間)
Les Beckham 2023 年 4 月 11 日
編集済み: Les Beckham 2023 年 4 月 11 日
You have to split up the compound condition into two conditions:
(x1 <= x) && (x <= x2)
If these terms are scalars, that will generate a scalar logical value. If they are not scalars, you should read about logical indexing.
Also, if you are just getting started with Matlab, I would highly recommend that you take a couple of hours to go through the free online tutorial: Matlab Onramp