how to delete all the elements from the matrix?
15 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
i want to delete all the elements from the matrix, and make the matrix empty.
1 Commento
Walter Roberson
il 27 Mar 2014
What data type is the matrix? Should the empty matrix have the same data type?
Risposte (3)
RAGHAVENDRA
il 27 Mar 2014
Modificato: RAGHAVENDRA
il 27 Mar 2014
Are you trying to make the matrix as null matrix or want to replace the elements with zeros(erasing the values). In the former case just use A=[];
0 Commenti
Jos (10584)
il 27 Mar 2014
Several options, depending on the desired result (same class, for instance):
A = []
A(:) = []
A = zeros(0,0,class(A))
0 Commenti
Vedere anche
Categorie
Scopri di più su Logical in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!