How can I plot the profile/skyline of an histogram from histcounts?
8 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
X = normrnd(3,10,[1,1000]);
[values, edges] = histcounts(X,100);
stairs(edges,values)
0 Commenti
Risposta accettata
Steven Lord
il 9 Mar 2022
If you have to go through histcounts first:
X = normrnd(3,10,[1,1000]);
[values, edges] = histcounts(X,100);
h = histogram('BinCounts', values, 'BinEdges', edges, 'DisplayStyle', 'stairs');
But if you don't have to go through histcounts first, just use histogram directly.
h = histogram(X, 100, 'DisplayStyle', 'stairs');
You get the same values and edges.
values2 = h.BinCounts;
edges2 = h.BinEdges;
isequal(edges, edges2)
isequal(values, values2)
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Histograms in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!