Effacer les filtres
Effacer les filtres

Histogram graph help?

1 vue (au cours des 30 derniers jours)
James Baker
James Baker le 25 Avr 2021
Commenté : James Baker le 25 Avr 2021
i have a vector called
r = zeros(1000, 1);
i use this vector to trap counts in some for and while loops... the for and while loops are working correctly and traping the values as expected.... i need the r vector wide to capture all the "potential" outcomes that "could" occur (because of probabilities) in the for and while loops.....this results in a large number of the r vector position having a zero value.
i want to plot a histogram graph of this vector r, but suppress all the zero locations. i just want to didplay the counts r vector in the histogram that are greater than zero..i cant figure out what attribute that is?
any suggestions?
  4 commentaires
James Baker
James Baker le 25 Avr 2021
yep thanks
James Baker
James Baker le 25 Avr 2021
actually the histogram (r(r~=0), nbins); won't actually work just tried it and got an error matlab didnt like it anyway, i used a bar chart to make the plot and that looks more like what i want anyway..;-) thanks though

Connectez-vous pour commenter.

Réponses (0)


En savoir plus sur 2-D and 3-D Plots dans Help Center et File Exchange





Community Treasure Hunt

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

Start Hunting!

Translated by