Finding and deleting negative values
9 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
I'm having trouble deleting negative values from a vector (vi) I wish to as an index:
vi =[-14:1:16];
I wrote this script:
l=length(vi); for i=1:l; while vi(i)<1; vi(i)=[]; break end end
Somehow, this only deletes the non-positive even numbered values in the matrix, not the negative ones (i.e. -14, -12, -10... disappear, but not -13, -11, -9)
Does anybody know why and can fix it for me?
0 comentarios
Respuesta aceptada
Más respuestas (0)
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!