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 comentario

David Goodmanson
David Goodmanson el 17 de Oct. de 2017
Hi alm,
for the first part you can check with all(a==b)

Iniciar sesión para comentar.

Respuestas (1)

Guillaume
Guillaume el 17 de Oct. de 2017

0 votos

What is the difficulty?
if isequal(a, b)
disp('Vectors are equal');
end

Categorías

Etiquetas

Preguntada:

el 17 de Oct. de 2017

Respondida:

el 17 de Oct. de 2017

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by