필터 지우기
필터 지우기

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 CenterFile Exchange에서 Histograms에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by