Problem 49577. Find the density of non-zero values
Find the density of a non-zero values in a matrix
ex: for a matrix [1 0; 0 1] the density of non-zero values is 2/4=0.5
note: Round the solution to 2 decimal places
Solution Stats
Solution Comments
Show commentsProblem Recent Solvers28
Suggested Problems
-
Return the first and last characters of a character array
9132 Solvers
-
Replace multiples of 5 with NaN
432 Solvers
-
Given a matrix, swap the 2nd & 3rd columns
1012 Solvers
-
4704 Solvers
-
107 Solvers
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!