vector of same size equality
显示 更早的评论
hello , I have vector a = [ 1 -1 1 1 ...] which is 30x1 and vector b = [-1 1 -1 .. ] of same size I want to check that if vector a is equal ( containing the same element) of vector b then print msg " vectors are equal " . thanks
1 个评论
David Goodmanson
2017-10-17
Hi alm,
for the first part you can check with all(a==b)
回答(1 个)
Guillaume
2017-10-17
What is the difficulty?
if isequal(a, b)
disp('Vectors are equal');
end
类别
在 帮助中心 和 File Exchange 中查找有关 Dates and Time 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!