delete zero elements from vector
13 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
zina shadidi
am 18 Nov. 2020
Kommentiert: zina shadidi
am 18 Nov. 2020
Hi
I have k (1,600) size, it contain zeros at 451-600 elements.
I want to delete these zero elements. At the end of this vector i want to add two elements with value equal to the last element .
thank you in advance
0 Kommentare
Akzeptierte Antwort
Weitere Antworten (1)
Setsuna Yuuki.
am 18 Nov. 2020
You can use:
k(k==0) = [];
k(length(k)+1:length(k)+2) = k(1,length(k));
Siehe auch
Kategorien
Mehr zu Graphics Object Programming finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!