How can I make a histogram from many text files?

1 回表示 (過去 30 日間)
Naoki Ishibashi
Naoki Ishibashi 2016 年 9 月 11 日
編集済み: michio 2016 年 9 月 11 日
I try to make a histogram from many text files; more than 1000 files. In my program, I can load all datas, and I can make histogram from one data, but I have problem in histogram from all data. If I use "hold" command, it are lay over each graphs horizontally, but I want to stuck datas horizontally. Please give me any advices.

回答 (1 件)

michio
michio 2016 年 9 月 11 日
編集済み: michio 2016 年 9 月 11 日
Assuming the situation where the all data would NOT fit in RAM, I'd suggested using histcouns function to get bin counts of all the text files one by one. Then use bar function to the sum of bin counts to create a histogram.
x = randn(10000,1);
[counts,edges] = histcounts(x); % do this for every file and add-up counts values
center = (edges(1:end-1)+edges(2:end))/2;
bar(center,counts,1)

カテゴリ

Help Center および File ExchangeHistograms についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by