【发布时间】:2023-04-07 08:22:01
【问题描述】:
这行代码有什么错误:
if BB(i) <= max([BB(i-4):BB(i)]) && BB(i) <= max([BB(i-7):BB(i)])
我收到以下错误消息:
??? Operands to the || and && operators must be convertible to logical scalar values.
Error in ==> if BB(i) <= max([BB(i-4):BB(i)]) && BB(i) <= max([BB(i-7):BB(i)])
【问题讨论】:
-
你有更多关于
BB的信息吗?另外我猜你的意思是max(BB((i-4):i)) -
@Suever:BB 是一个向量。你说得对,我的意思是 max(BB((i-4):i))。谢谢。
标签: matlab logical-operators operands