This isn't very compact code, but is this what you want?
MTT = cell(12:1);
%Generating random matrices...mth matrix of mean m and unit variance
for m = 1:12
MTT{m} = m + randn(120);
end
matmins = zeros(1,length(MTT));
diagmins = zeros(1,length(MTT));
for n = 1:length(MTT);
M = MTT{n};
diagmins(n) = min(diag(M));
matmins(n) = min(min(M));
end
%diagmins is an array of all diagonal minimums...matmins an array of
%complete matrix minimums
"Diego Zegarra" <diegozbb@gmail.com> wrote in message <gd7qdq$h2p$1@fred.mathworks.com>...
> Hey guys I need help with this. If I have an array which is,
>
> MTT = cell(12:1)
>
> and each cell of that array (e.g. MTT{1}) has a matrix of 120 x 120 and I want to find the minimum number out of the diagonal of each matrix and just get the minimum number out of all 12 cells how can I do that?
>
> I am using the following,
>
> [a b] = min(diag(MTT{idx}));
>
> which gives me the minimum but it overrides every time. Should I create an array to save this minimum numbers? How do I get the minimum number out of that array then?
>
> Thanks for your help and I hope I made myself clear.
