Need help writing an if statement involving vectors. Total mental block :/
显示 更早的评论
I have a vector:
A=[14 13 12 11 10]
And I'm given another vector B that's the same length of A, and contains any numbers.
I need to write an if statement determining if this vector B contains the same numbers as A (even if the numbers are arranged differently than in A)
NOTE: INCORRECT SYNTAX, but here's the idea
if B==A
disp('B is equal to A')
else
end
3 个评论
Star Strider
2015-5-5
Since you Accepted my Answer by accident, I deleted it. (I get the points anyway, but you can now Accept Charlie’s Answer so he will as well.)
Trevor Zane Simko
2015-5-5
Star Strider
2015-5-5
My pleasure. It’s not the first time I misinterpreted a Question!
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Logical 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!