Asked by PRIYANGA
on 13 Jul 2012

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.

*No products are associated with this question.*

Answer by Sebastian Holmqvist
on 13 Jul 2012

z_elem = nnz(nnz == 0) nz_elem = nnz(nnz ~= 0)

Then do your calculations on each.

Opportunities for recent engineering grads.

## 0 Comments