Operands to the || and && operators must be convertible to logical scalar values.
7 次查看(过去 30 天)
显示 更早的评论
Dear All The code that I am working with is separated to sections with function command. After running the code with input parameters this error occurs. (Operands to the and && operators must be convertible to logical scalar values) However, when I insert the values of the parameters inside the code, then running it , I found it is running. I don't want to insert the parameters values in the code directly ,I want to feed the parameters as input as follow: WaRa(1, 9.81, 0.017, 0, 8.8, 15.2, 1, 1, 0, 0, 2, 4, 0, 36.9, 15.2) any suggestion please?
0 个评论
采纳的回答
Thomas
2012-4-18
try using
| and &
instead of
|| and &&
since the && is the Short-circuit logical AND while the & operator is element wise logical and.. which might be what you need.. Cannot say with certainty without looking at the code..
0 个评论
更多回答(1 个)
另请参阅
类别
在 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!