get a matrix of only zero
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
How can I get a mattrix made of only zeros?
For example I have this matrix
[2 4 0 5 6 0]
I would get a matrix made of only zeros
0 Kommentare
Antworten (4)
Walter Roberson
am 10 Nov. 2012
Bearbeitet: Walter Roberson
am 10 Nov. 2012
NewMatrix = 0 .* OldMatrix;
(Mind you, this has a problem if any of the entries were infinite or NaN)
0 Kommentare
Siehe auch
Kategorien
Mehr zu Logical 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!