After seeing some posts on cell arrays here in the forum I was able to solve my cell arrays problem. I was able to obtain the mean of inner cell array elements.
Sharing it here in case someone may find it useful. The solution worked for me when I used vertcat(), but the more the inner cells the more the use of vertcat to unnest the cell arrays. I am sure there must be some easy way to solve this. I would appreciate it, if anyone can suggest better ways of doing it.
Alslo please let me know how to use the vectors instead of for loop. I have read at places that using vectors is better than for loop. I would like to how or why is it better .
The code I tried:
clc;
clear all;
load('corMean.mat');
% cnt = count of folders - 8 in this case
% n = number of files in each folder - 30 for now (can vary)
% k = number of blobs in each image - in first folder, n images have 1 blob
% whereas the remaining folders with n images have 2 blobs each.
for cnt=1:size(corMean,2)
for n=1:size(corMean{cnt},1)
for k=1:(size(corMean{cnt},2))
corMeanCat{cnt}{:,k}=[vertcat([corMean{cnt}{:,k}])];
catOf_CorMeanCat{cnt}{k}= [vertcat([corMeanCat{cnt}{k}])];
meanOfAllCorMeans{cnt}{k}=mean([catOf_CorMeanCat{cnt}{:,k}{:}]);
end
end
end