Info

この質問は閉じられています。 編集または回答するには再度開いてください。

I have 2 set of numbers A & B with elements 1-10, I want to determine an expression which requires different values of A & B such like, when A>=6 and B<=3 but my if statement giving the error || and && must be convertible to logical scalar

1 回表示 (過去 30 日間)
olawoyin abiodun
olawoyin abiodun 2015 年 6 月 29 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
I have 2 set of numbers A & B with elements 1-10, I want to determine an expression which requires different values of A & B such like, when A>=6 and B<=3 but my if statement giving the error || and && must be convertible to logical scalar
  1 件のコメント
Stephen23
Stephen23 2015 年 6 月 29 日
編集済み: Stephen23 2015 年 6 月 29 日
MATLAB has different logical operators, which are useful in different situations. The short-circuit operators && and || are used only with scalar values. If the values are not scalar, then you must use the normal logical operators & and |.

回答 (1 件)

Walter Roberson
Walter Roberson 2015 年 6 月 29 日
Don't use && and || then. Use & and |

この質問は閉じられています。

タグ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by