MATLAB: Sum of N matrices

addevalhorrible ideamatricesseveral

The reason for this new message was to request a new favor.
Is there a code or function in matlab that allows me to add an undefined number (N) of matrices, which I already have a program? As an example I put the following situation to be understood better:
Aux = Mat (1) + Mat (2) + Mat (3) + .... + Mat (n)
I thank you for your attention and I hope you can help me with my predicament.

Best Answer

I've modified the example of my comment.
n = 12;
sz = [3,3];
MKG = nan( sz(1),sz(2), n );
for ix = 1 : n
MKG(:,:,ix) = ones(sz); % inv(M_Trans)*M_Kele*M_Trans;
end
sum( MKG, 3 )
outputs
ans =
12 12 12
12 12 12
12 12 12
>>