Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
您将如何实施:
if(m <= 0.1) ... end
如果 m 不是标量。我尝试了一些类似的东西:
array = ones(length(m), 1) .* 0.1; if(m <= array) ... end
没有成功。
你可能想要
if all(m <= 0.1)
但也许
if any(m <= 0.1)
它甚至是该all功能的示例之一。
all
但事实上,文档if表明
if
if (m <= 0.1)
也应该可以正常工作。