Readonly: Operands to the || and && operators must be convertable to logical scalar values. is eqal3, 153
3 次查看(过去 30 天)
显示 更早的评论
![error.png](https://www.mathworks.com/matlabcentral/answers/uploaded_files/225596/error.png)
Hi, Can any one have idea, how to resolve it. This is freqently appearing when I run my code.
0 个评论
回答(1 个)
Aravind Ravikumar
2019-6-20
You get this when one or both operands are arrays. E.g.,
>> [1 2 3] && [4 5 6]
Operands to the || and && operators must be convertible to logical scalar values.
Check the two expressions or variables you are using for the || or && operation. You are using them as scalars but they are not.
2 个评论
Aravind Ravikumar
2019-6-20
The only way I can imagine the error being genereted is cause of z_c(k,1).size(1,x) not being a scalar. Could you maybe try logging that before the if statements? Also, could you try using z_c(k).size(x) instead?
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 EEG/MEG/ECoG 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!