CDF plot for data

조회 수: 7 (최근 30일)
Ameer Arsalaan
Ameer Arsalaan 2018년 1월 31일
댓글: Birdman 2018년 2월 1일
I am new to MATLAB and want to plot a cdf for data sets: Q=[824,1829,5589,13958,19938,28680,31719,40276,48840,65849] B=[463,851,2019,4891,6292,9808,7535,9493,9684,10393] S=[1268,2534,7698,15522,18623,29795,32458,38962,49725,57328] w.r.t x=[10,20,30,40,50,60,70,80,90,100] in the same plot to show how much area is under the curve for Q,B,S w.r.t x=10,20,.....,100. Can somebody provide me with the code for doing this?
  댓글 수: 1
Ameer Arsalaan
Ameer Arsalaan 2018년 2월 1일
Thanks @Birdman. The code plots 3 separate graphs. I need to plot all the data in same plot.

댓글을 달려면 로그인하십시오.

채택된 답변

Birdman
Birdman 2018년 1월 31일
Try this:
mu=[mean(Q) mean(B) mean(S)];sigma=[std(Q) std(B) std(S)];
pdQ=makedist('Normal',mu(1),sigma(1));
pdB=makedist('Normal',mu(2),sigma(2));
pdS=makedist('Normal',mu(3),sigma(3));
%Q
y1=cdf(pdQ,x)
cdfplot(y1)
%B
y2=cdf(pdB,x)
cdfplot(y2)
%S
y3=cdf(pdS,x)
cdfplot(y3)
  댓글 수: 2
Ameer Arsalaan
Ameer Arsalaan 2018년 2월 1일
Thanks @Birdman. The code plots 3 separate graphs. I need to plot all the data in same plot.
Birdman
Birdman 2018년 2월 1일
Use hold on command at the beginning of your code.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by