finding mean
Show older comments
I have a 30 matrix of size 256x256 stored in in different variables,
for ex the variables are A,D,R,T,Y,......ETC,EACH variable has same matrix size,now i want to find mean for each matrix and store it s mean values in a separate variable ,please help
Accepted Answer
More Answers (2)
Walter Roberson
on 12 Jun 2012
1 vote
Andrei Bobrov
on 13 Jun 2012
a = whos;
b = strcat({a(cellfun(@(x)isequal(x,[256 256]),{a.size})).name},',');
AD_etc = eval(['{',[b{:}],'}']);
AD_mean = cellfun(@(x)mean(x(:)),AD_etc,'un',0);
out = cell2struct([AD_etc;AD_mean],{'data','mean'});
Categories
Find more on Resizing and Reshaping Matrices in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!