operators must be convertible to logical scalar values
1 回表示 (過去 30 日間)
古いコメントを表示
Riccardo Tronconi
2021 年 7 月 21 日
回答済み: Walter Roberson
2021 年 7 月 21 日
Dear guys! I'm struggling to solve this dummy issue. Here it is my code:
if Inan> Istart && (Inan<Iend || isempty(Iend)==1)
Iend=Inan - 1;
end
the error is : Operands to the logical and (&&) and or (||) operators must be convertible to logical scalar values.
Thanks in advance!
0 件のコメント
採用された回答
Walter Roberson
2021 年 7 月 21 日
If Iend is empty then Inan<Iend is empty and you would be trying to use (empty || something) but operands for || must be scalars.
You should test for empty before testing <
Note: you can use just isempty(Iend) instead of isempty(Iend)==1
0 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Data Type Conversion についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!