Delete elements in a array
이전 댓글 표시
Hi, I have a large array. I want to delete certain elements in the array. I want to delete the 390th element, and then after that every 391th element......
So need to delete 390, 781, 1182 etc..........
채택된 답변
추가 답변 (1개)
Wayne King
2012년 4월 21일
X = randn(100,100);
% not sure how far you want the vector to go
indices = 390:391:1e4;
X(indices) = [];
Then you'll need to reshape X into an array. Or you can just replace the elements with NaNs
X = randn(100,100);
% not sure how far you want the vector to go
X(indices) = NaN;
댓글 수: 2
Mate 2u
2012년 4월 21일
Image Analyst
2012년 4월 22일
Yes. 48996 to be precise, just like it does give you in the 1D version above.
카테고리
도움말 센터 및 File Exchange에서 Operators and Elementary Operations에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!