How can I Read or get the Values one by one from matrix variable or array?
Ältere Kommentare anzeigen
Sir or Madam,
I want to read the array variable one by one from array or matrix? How can i write the code? I want to calculate the Zero Element and Non Zero Element in the matrix?
I have use s=nnz(x);
but i want to get the values one by one and the compare and calculate the zero and nonzero element.
thank you sir/madam.
Akzeptierte Antwort
Weitere Antworten (1)
Sebastian Holmqvist
am 13 Jul. 2012
z_elem = nnz(nnz == 0)
nz_elem = nnz(nnz ~= 0)
Then do your calculations on each.
1 Kommentar
PRIYANGA
am 13 Jul. 2012
Kategorien
Mehr zu Logical 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!