Remove elements in Matrix
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
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 comentarios
Respuesta aceptada
Walter Roberson
el 12 de Oct. de 2011
Position(TheIndices) = [];
Time(TheIndices) = [];
4 comentarios
Walter Roberson
el 18 de Oct. de 2011
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);
Más respuestas (0)
Ver también
Categorías
Más información sobre Line Plots en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!