replacing items in a matrix
조회 수: 2 (최근 30일)
이전 댓글 표시
I have a vector:
A = 6:2:19;
and
r = 10;
I want to replace the element in A which corresponds to r with nothing.
So I want my new vector A = [6, 8, 12, 14, 16, 18];
How do I do that?
댓글 수: 0
채택된 답변
Walter Roberson
2018년 4월 8일
A(A==r) = [];
If r is a vector or array then
A(ismember(A,r)) = [];
댓글 수: 0
추가 답변 (1개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Graphics Object Properties에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!