Given a Matrix M, find out the number of elements of matrix that are divisible by 3.
M = [1 2 3;4 5 6;7 8 9];
out = 3 M = [32 12 15; 2 6 45];
out = 4
Solution Stats
Problem Comments
Solution Comments
Show comments
Loading...
Problem Recent Solvers166
Suggested Problems
-
Flip the main diagonal of a matrix
922 Solvers
-
We love vectorized solutions. Problem 1 : remove the row average.
895 Solvers
-
Generate a vector like 1,2,2,3,3,3,4,4,4,4
14216 Solvers
-
Who has power to do everything in this world?
489 Solvers
-
18303 Solvers
More from this Author3
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!