MATLAB Answers

How can I delete two or more elements in a vector?

2 views (last 30 days)
For example,
A = [1 1 2 3 10 7 10 1 5 3]
two or more elements in A is 1, 3, 10.
delet two or more elements in A
-> A = [2 5 7]
How can I edit it?

  0 Comments

Sign in to comment.

Accepted Answer

Stephen Cobeldick
Stephen Cobeldick on 11 Jan 2020
>> A = [1,1,2,3,10,7,10,1,5,3];
>> U = unique(A);
>> Z = U(histc(A,U)==1)
Z =
2 5 7

  0 Comments

Sign in to comment.

More Answers (0)

Sign in to answer this question.


Translated by