Effacer les filtres
Effacer les filtres

How to delete the same element in matrix?

1 vue (au cours des 30 derniers jours)
win le 15 Mai 2013
i have a matrix
if true
B = input('enter the element to delete(enter any one 1,2,5,8,6,)= ')
A = [1 2 5 8 6];
When i enter any one of the number in the input, then delete that element in the matrix. how can i do please help.

Réponse acceptée

Jan le 15 Mai 2013
Modifié(e) : Jan le 15 Mai 2013
A(A==B) = [];
A = A(A ~= B);
  2 commentaires
win le 15 Mai 2013
thank youuuuuuuuuu
Jan le 15 Mai 2013
You are welcome. You have seen, that this answer took 3 hours. But such fundamental methods are explainbed exhaustively in the Getting Started chapters of the documentation. I suggest to read them, because you will get the wanted answers much faster then.

Connectez-vous pour commenter.

Plus de réponses (0)


En savoir plus sur Logical dans Help Center et File Exchange


Community Treasure Hunt

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

Start Hunting!

Translated by