Goodness of fit test
조회 수: 1 (최근 30일)
이전 댓글 표시
Hi,
I want to plot graph of variables "N" and "intf" with same xaxis. Intf should take values of x from range(600 to 800) with interval of .5. These values should be stored in a cell array or matrix. Then plot for these values will be drawn. After this goodnessof fit will be calulated between N and intf values. I have attached code. kindly help me.
syms x
load Book1.txt;
wave=Book1(:,1);
corr=Book1(:,2);
Efficiency=Book1(:,3);
experiment=Book1(:,4);
counts=(experiment/corr);
Photoelectrons=((counts-50)*4)/1;
Photons=((Photoelectrons)*(Efficiency));
Energy =(Photons*(1240/wave));%(nm)
W=(Energy/100);
N=(W/(5.3*10^(-12)));
yyaxis left
plot(wave,N)
hold on
h=6.62e-34;%J*s
c=3e8;%m/s
k=1.38E-23;%J/K
T=610;
z=5.67e-8;
f=(((15*z)/(3.14^4))*((k*T)/(h*c))*(x^4));
intf=int(f);
yyaxis right
a=fplot(intf,[600 800]);
hold off
fit = goodnessOfFit(a,N,cost_func);
댓글 수: 1
Image Analyst
2021년 7월 2일
You forgot to attach 'Book1.txt'.
And replace
syms x
with
x = 600 : 0.5 : 800;
답변 (1개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Calculus에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!