sfit data array output

2 visualizaciones (últimos 30 días)
Asliddin Komilov
Asliddin Komilov el 26 de Sept. de 2019
Comentada: darova el 7 de Oct. de 2019
Hi, I have this:
SS_fit_Xs=fit(Wave_length,real_Solar_spectrum,'poly9');
then I can plot it so easily like this:
plot(SS_fit_Xs,Wave_length,real_Solar_spectrum);
but to get fitted curve as data I have to write down very long formula with 10 coefficients.
Is there any way to do it in a shorter line?
thanks
  1 comentario
Asliddin Komilov
Asliddin Komilov el 6 de Oct. de 2019
now I have this
A=xlsread('ASTMG173.xls');
real_Solar_spectrum=A(:,3);%W/m2
Wave_length=A(:,1)./1e9;% m
SS_fit_Xs=fit(Wave_length,real_Solar_spectrum,'poly9');
SS_fit=SS_fit_Xs(1)*Wave_length.^9+SS_fit_Xs(2)*Wave_length.^8 ...
+SS_fit_Xs(3)*Wave_length.^7+SS_fit_Xs(4)*Wave_length.^6 ...
+SS_fit_Xs(5)*Wave_length.^5+SS_fit_Xs(6)*Wave_length.^4 ...
+SS_fit_Xs(7)*Wave_length.^3+SS_fit_Xs(8)*Wave_length.^2 ...
+SS_fit_Xs(9)*Wave_length+SS_fit_Xs(10);
and SS_fit doesn't look even close to real_Solar_spectrum.
can you help?
thanks

Iniciar sesión para comentar.

Respuestas (1)

darova
darova el 6 de Oct. de 2019
This code
A = xlsread('ASTMG173.xls');
x = A(:,1);
y = A(:,3);
plot(x,y)
Produces
img1.png
Is it the curve you want to approximate?
  2 comentarios
Asliddin Komilov
Asliddin Komilov el 7 de Oct. de 2019
Editada: Asliddin Komilov el 7 de Oct. de 2019
yes, but rather x = A(:,1)./1e9, since it makes the difference in fit.
darova
darova el 7 de Oct. de 2019
Is it the way the approximated curve should looks like?
11Untitled.png

Iniciar sesión para comentar.

Categorías

Más información sobre Fit Postprocessing en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2016a

Community Treasure Hunt

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

Start Hunting!

Translated by