Remove elements in Matrix
조회 수: 3 (최근 30일)
이전 댓글 표시
I plotted Position vs Time data. The user is then able to click and select points that are bad(noise). No problem so far. What is the best way to remove the selected points from the Position and Time matrices? I have a list of the indices for the points being removed.
댓글 수: 0
채택된 답변
Walter Roberson
2011년 10월 12일
Position(TheIndices) = [];
Time(TheIndices) = [];
댓글 수: 4
Walter Roberson
2011년 10월 18일
if ~isempty(TheIndices)
sz = size(Position);
Position(TheIndices) = [];
Time(TheIndices) = [];
Position(prod(sz)) = 0; %0 fill
Time(prod(sz)) = 0; %0 fill
Position = reshape(Position,sz);
Time = reshape(Time,sz);
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Line Plots에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!