how can i build a for loop to create histograms for a multiple cell array?
古いコメントを表示
i have a multiple array cells (result):


there are 20 cells and each cell contains other 20 cells. I would like to create an histogram of each cell data, so in total 400 histograms. I built this code but if I have ii=1 i have L_nod starting from result{1,1}{1,2}. I want that it starts from result{1,1}{1,1} and increase each time.
for ii = 1:length(result)
figure(ii)
L_nod = result{1,ii}(:,ii+1)
L_nodo1 = cell2mat(L_nod);
[n,x] = hist(L_nodo1,50);
n = n/length(L_nodo1)/diff(x(1:2));
bar(x,n,'hist')
pngFileName = sprintf('hist%d.png',ii);
fullFileName = fullfile(folder, pngFileName);
saveas(gcf,fullFileName);
end
maybe is not clear, if anybody has a new code to suggest to me i'm glad :).
Thanks!
2 件のコメント
Image Analyst
2019 年 3 月 6 日
Can you attach the results in a .mat file?
And why is result a cell array? From what I see, it could be done much simpler with just a regular double array. I mean, none of the arrays have different sizes -- they're all 80 by 1 -- so why use cells instead of a 2-D double array?
EM geo
2019 年 3 月 7 日
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Loops and Conditional Statements についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!