Goodness of fit test

2 views (last 30 days)
Nadia jabeen
Nadia jabeen on 2 Jul 2021
Answered: Nadia jabeen on 2 Jul 2021
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 Comment
Image Analyst
Image Analyst on 2 Jul 2021
You forgot to attach 'Book1.txt'.
And replace
syms x
with
x = 600 : 0.5 : 800;

Sign in to comment.

Answers (1)

Nadia jabeen
Nadia jabeen on 2 Jul 2021
I have attached txt file

Community Treasure Hunt

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

Start Hunting!