deleting number
이전 댓글 표시
i have values such as A=[12 20 1 5 69 70 21 50 46 52 87 83 11 21]
B=[ 70 50 12 83]
now i want to delete B values from A ,so i will have output as
C=[20 1 5 69 21 46 52 87 11 21 ]
채택된 답변
추가 답변 (1개)
Wayne King
2012년 2월 28일
Hi, You can use intersect to get the indices of A that intersect with elements of B and then delete those.
[C,IA,IB] = intersect(A,B);
A(IA) = [];
댓글 수: 3
kash
2012년 2월 28일
Oleg Komarov
2012년 2월 28일
Sounds like a homework.
Jan
2012년 2월 28일
No, kask, it is impossible to do this "without built-in command", because all you can write in Matlab requires built-in commands. If your teacher told you to do this, ask him for thinking twice.
카테고리
도움말 센터 및 File Exchange에서 Assembly에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!