I have a 1×15 cell which contains 15 matrices, and each of them has different number of rows but all have the same number of columns(14). I am trying to find the mean and covariance of the whole cell. I compute them by concatenating all matrices into a big matrix and use the built-in functions to get the result, which looks like this:
M = C{1}; for i=2:15 M = [M; C{i}]; end mean = mean(M); cov = cov(M);
I think this approach does not fully take advantage of the flexibility of cells. Is there a more efficient way to do that?
Best Answer