Goodness of fit test

2 次查看(过去 30 天)
Nadia jabeen
Nadia jabeen 2021-7-2
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
Image Analyst 2021-7-2
You forgot to attach 'Book1.txt'.
And replace
syms x
with
x = 600 : 0.5 : 800;

请先登录,再进行评论。

回答(1 个)

Nadia jabeen
Nadia jabeen 2021-7-2
I have attached txt file

类别

Help CenterFile Exchange 中查找有关 Calculus 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by