How to add a trendline to a histogram plot and not show the histogram?

12 vues (au cours des 30 derniers jours)
Zeynab Mousavikhamene
Zeynab Mousavikhamene le 25 Fév 2020
Réponse apportée : darova le 25 Fév 2020
I need to add a trendline to the histogram and becuase I have several datasets I want to remove the histogram and keep only trendlines.
Any idea?

Réponses (1)

darova
darova le 25 Fév 2020
Here is my solution
x = randi(100,1,100);
hist(x,20);
[y,x0] = hist(x,20);
hold on
plot(x0,y)
hold off

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by