Normal Distribution and area under the curve
Show older comments
Hello, I am just looking to make my hw a little fancier than is needed.
The question is asking to find the % of drivers that will get a ticket, if tickets are issued 72mph and above, with a mean speed of 67.
clear;clc;
x_bar=67; %mph
x_ticket=72; %mph that will receive a ticket
s=4; %standard deviation
z1=(x_ticket-x_bar)/s;
pz=0.3944; %from table 4.3
disp('The percent of drivers exceeding 72mph is')
P=(0.5-pz)*100
rng(0,'twister')
a=4; %standard deviation
b=67; %mean value
y=a.*randn(1000,1)+b;
pd=fitdist(y,'Normal')
x=[-3:.1:3]; %+/- 15 from the mean
y=normpdf(x,0,1);
plot(x,y)
I think I am rpetty close. I just want to figure out how to get MATLAB to plot this data, and shade the ticketed region. Like the picture below.
furthermore, extra points, how can i get the area under the curve?
Thanks!
R2022a (beta)

Accepted Answer
More Answers (0)
Categories
Find more on Data Distribution Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!