There are several set functions that could apply to your problem. One that comes quickly to mind is ismember with the 'rows' option.
How to use if statement with an array
3 次查看(过去 30 天)
显示 更早的评论
I want to find out if an array equals a particular set of values, as follows:
if arrayName=[0 1 1 0]
do this
end
And so on, MATLab throws up an error saying it expects a scalar value. Am I using the brackets wrong, or is this something that cannot be done? (I am quite new to MATLab).
Cheers, Nick
0 个评论
采纳的回答
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Loops and Conditional Statements 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!