Write a function that computes the sum of all elements of the input array v without using the following built-in function:
sum, trace, mean, norm, diag, numel, size, ans,width,height
The input v may be a vector or a matrix of any size.
If the input is empty, the function must return 0.

Solution Stats

42 Solutions

18 Solvers

Last Solution submitted on Aug 01, 2026

Last 200 Solutions

Problem Comments

Solution Comments

Show comments
Loading...

Problem Recent Solvers18

Suggested Problems

More from this Author24

Problem Tags

Community Treasure Hunt

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

Start Hunting!