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

2 次查看(过去 30 天)
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?

采纳的回答

Stephen23
Stephen23 2020-1-11
>> 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 个)

类别

Help CenterFile Exchange 中查找有关 Matrices and Arrays 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by