SyntaxFix
Write A Post
Hire A Developer
Questions
Another answer for the first question is to use one for loop and perform linear indexing into the array using the function NUMEL to get the total number of elements:
total = 0; for i = 1:numel(A) total = total+A(i); end