Borrar filtros
Borrar filtros

How can I make a histogram from many text files?

1 visualización (últimos 30 días)
Naoki Ishibashi
Naoki Ishibashi el 11 de Sept. de 2016
Editada: michio el 11 de Sept. de 2016
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.

Respuestas (1)

michio
michio el 11 de Sept. de 2016
Editada: michio el 11 de Sept. de 2016
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)

Categorías

Más información sobre Histograms en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by