Given the matrix x, return the sum of all elements of matrix.

Example:

 Input  x = [ 1 2 0 0 0
              0 6 9 3 3 ]
 Output y is 24.
 Input  x = [ 1 NaN 0 0 0
              0 6 9 3 3 ]
 Output y is NaN.

Solution Stats

579 Solutions

446 Solvers

Last Solution submitted on Feb 17, 2026

Last 200 Solutions

Problem Comments

Solution Comments

Show comments
Loading...

Problem Recent Solvers446

Suggested Problems

More from this Author6

Problem Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!