delete null in matrix
Ältere Kommentare anzeigen
I have matrix M=[ 0 0 0 7.9286 10.1000 14.3714]
I want to delete null in matrix.
I want matrix M=[7.9286 10.1000 14.3714]
Thanks
Akzeptierte Antwort
Weitere Antworten (1)
sixwwwwww
am 14 Dez. 2013
do it like this:
M=[ 0 0 0 7.9286 10.1000 14.3714];
M = M(M ~= 0)
5 Kommentare
Tomas
am 14 Dez. 2013
Bearbeitet: Azzi Abdelmalek
am 14 Dez. 2013
sixwwwwww
am 14 Dez. 2013
do it as follow:
M = [0 0 0 7.9286 10.1000 14.3714];
M = (M(M ~= 0))'
Also I like to ask you do you have values in a matrix or in just in a vector
sixwwwwww
am 14 Dez. 2013
do you want to convert them to a column vector of non-zero values?
Tomas
am 14 Dez. 2013
Kategorien
Mehr zu Matrix Indexing finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!