HOW TO PLOT SMOOTH OR THEORETICAL CDF?
显示 更早的评论
Attached is the plot of CDF based on the actual data. Also, I want to plot smooth(or theoretical) CDF in the same figure. To this goal, please let me know how to write a code. here is the whatever I have done so far:
damage_Mean=mean(damageY);
damage_Std=std(damageY);
damage_srt=sort(damageY);
damP=cdf('Normal',damage_srt,damage_Mean,damage_Std);
IM_x=linspace(min(IM), max(IM),size(damP,1))';
plot(IM_x,damP,'ro',IM_x,damP,'b');
3 个评论
I deleted the answer because it didn't provide anything new really. After revisiting the question I realized you already calculate the theoretical function using cdf(), whereas I've only ever used normcdf.
So, let's make a new attempt. What is IM? I believe you are supposed to plot damP against damage_srt.
Try the following:
cdfplot(damageY);hold on
damage_norm=cdf('Normal',damage_srt,damage_Mean,damage_Std);
plot(damage_srt,damage_norm)
is that what you are looking for?
Mos_bad
2018-6-6
jonas
2018-6-6
Sorry, I'm still not sure what you mean. You say that the actual data is plotted, however what you have plotted is damageP which is certainly not the actual data. You are also plotting the same thing twice, which adds to the confusion.
As a sidenote, I would edit the question and put the data on top. Perhaps someone smarter than me can chime in
回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Exploration and Visualization 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!