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

2 Ansichten (letzte 30 Tage)
Han
Han am 11 Jan. 2020
Beantwortet: Stephen23 am 11 Jan. 2020
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?

Akzeptierte Antwort

Stephen23
Stephen23 am 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

Weitere Antworten (0)

Kategorien

Mehr zu Matrices and Arrays finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by