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.
Impossible de terminer l’action en raison de modifications de la page. Rechargez la page pour voir sa mise à jour.
Translated by
Sélectionner un site web
Choisissez un site web pour accéder au contenu traduit dans votre langue (lorsqu'il est disponible) et voir les événements et les offres locales. D’après votre position, nous vous recommandons de sélectionner la région suivante : .
Vous pouvez également sélectionner un site web dans la liste suivante :
Comment optimiser les performances du site
Pour optimiser les performances du site, sélectionnez la région Chine (en chinois ou en anglais). Les sites de MathWorks pour les autres pays ne sont pas optimisés pour les visites provenant de votre région.