vector of same size equality
Show older comments
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 Comment
David Goodmanson
on 17 Oct 2017
Hi alm,
for the first part you can check with all(a==b)
Answers (1)
Guillaume
on 17 Oct 2017
What is the difficulty?
if isequal(a, b)
disp('Vectors are equal');
end
Categories
Find more on Dates and Time in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!