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

조회 수: 2 (최근 30일)
Han
Han 2020년 1월 11일
답변: Stephen23 2020년 1월 11일
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