Pretty sure you can't. From the documention for histogram
histogram('BinEdges',edges,'BinCounts',counts) manually specifies bin edges and associated bin counts. histogram plots the specified bin counts and does not do any data binning.
From the last sentence, you can see that creating a histogram this way does not include the underlying data. Just the counts. To me that means rebinning is not possible from the edges and counts data.
I'm analyzing timestamps from a single photon detector. I populate the bins as I go. In 1 second of data collection, I have nearly 25 million timestamps. My file is huge as it runs for about an hour. So I'd have around 20x10^9 items in my data file if I saved each data point. )-:
As it is, my native histogram bins range from -400000 to +400000 in steps of 1 (these are picoseconds), so 800001 total bins with 1000s of stampstamps registering in each bin.
I'd like to be able to condense to bins of 25 ps 50 ps, 250 ps. In the past, I would write a for/next loop. But that is a pain and this problem comes up now and then, and I was hoping there were more sophisticated histogram objects or functions that could do this for me.
If it's still open, you can update a property and it redraws the histogram. Making the bins wider does not reduce the data saved in the object, though. It just changes the appearance.
x = randn(10000,1);
h = histogram(x);
% the original has bins ever 0.2. Modify to have width of 2.
I'm analyzing timestamps from a single photon detector. I populate the bins as I go. In 1 second of data collection, I have nearly 25 million timestamps. My file is huge as it runs for about an hour. So I'd have around 20x10^9 items in my data file if I saved each data point. )-:
That sounds like it could be Big Data. Can you store the data as a tall array backed by a datastore array, perhaps a tabularTextDatastore or a spreadsheetDatastore? You can create a histogram using that tall array. See this documentation page for more information.
Impossibile completare l'azione a causa delle modifiche apportate alla pagina. Ricarica la pagina per vedere lo stato aggiornato.
Translated by
Seleziona un sito web
Seleziona un sito web per visualizzare contenuto tradotto dove disponibile e vedere eventi e offerte locali. In base alla tua area geografica, ti consigliamo di selezionare: .
Puoi anche selezionare un sito web dal seguente elenco:
Come ottenere le migliori prestazioni del sito
Per ottenere le migliori prestazioni del sito, seleziona il sito cinese (in cinese o in inglese). I siti MathWorks per gli altri paesi non sono ottimizzati per essere visitati dalla tua area geografica.