MATLAB: How to plot histogram pdf I nedd help to scale the y-axis of Gaussian pdf for example: x = linspace(-20,20); plot(x,normpdf(x,4,4)) How can I plot the histogram of this example? Best Answer x = linspace(-20,20);y = normpdf(x, 4, 4);plot(x,y) histogram(y, 10) Related SolutionsMATLAB: Histfit help Hi, One way:% generate 1,000 N(10,2^2) RVsR = normrnd(10,2,1e3,1);% get an estimate of mu and sigma from the "data"[muhat,sigma] = normfit(R);% construct histogram[F,X] = hist(R,30);% get ready to plot as probability histogramF = F/trapz(X,F);bar(X,F); hold on;% use muhat and sigma to construct pdfx = muhat-3*sigma:0.01:muhat+3*sigma;% plot PDF over histogramy = normpdf(x,muhat,sigma);plot(x,y,'r','linewidth',2); MATLAB: How to plot distribution curve of multiple data x = [-3:.1:3];y = normpdf(x,0,1);y2 = normpdf(x,0,0.5);plot(x,y,x,y2)More info:https://es.mathworks.com/help/stats/normal-distribution.html Related QuestionOvlay cdf plot on histogramHow to calculate and plot the histogram of DCT coefficients of an imageHow to plot a probability density function on a histogramNormalizing a normal distributionPlot normal distribution plot on histogram of residualsHow to plot a mixed density functionHow to plot a probability distribution object
Best Answer