Finding and deleting negative values
9 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaires
Réponse acceptée
Plus de réponses (0)
Voir également
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!