Average for each value from a set of matrices
Info
This question is closed. Reopen it to edit or answer.
Show older comments
I'm a rookie in this world and I have the following question.
How do I calculate from a set of matrices the mean for each value?
If I have 1[A, B, C], 2 [A, B, C], 3 [A, B, C] and finally obtain a new matrix X [A, B, C] with the means for A, B and C.
for i=1:length(files)
for j=1:length(files)
X(i,j)= mean(X(1:length(files)). name(i,j)
end
This expression do not work, Any idea??
Thank you in advance!
Answers (2)
Azzi Abdelmalek
on 4 Aug 2013
a=[1 2 3];
b=[4 5 6];
c=[7 8 9]
d=[mean(a) mean(b) mean(c)]
If it's not what you are looking for, give an example
2 Comments
Azzi Abdelmalek
on 4 Aug 2013
Jean commented
First, thank you so much for your quick Abdelmalek!
But exactly, what I pretend to do is a new matrix and with your example, the new matrix has the average for each value/box.
d=[4, 4.33, 6]
Thanks again!
Jan
on 4 Aug 2013
Perhaps you are looking for something like this:
a = [1 2 3];
b = [4 5 6];
c = [7 8 9];
m = (a + b + c) / 3
This question is closed.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!