Hello all,
I have raw data (column B) and fit data (column A). I am wondering what fit was it?. Can anyone please have a look at the data and fit (graph) and clarify my doubt?. How do I perform it in MatLab?. Kindly help.

3 comentarios

jonas
jonas el 3 de Ag. de 2018
Editada: jonas el 3 de Ag. de 2018
Looks more like a moving average filter than a fitted equation. Are you sure it's a fit?
A moving average filter goes over your data point-by-point and calculates an average within a range (window) from that point. See for example the MATLAB function smooth . Your fit does not look parametric in nature as it retains the noise (although damped out). More likely some type of filter.
Devan Krishnamurthy
Devan Krishnamurthy el 3 de Ag. de 2018
Thank you Jonas. I will look into it.
jonas
jonas el 3 de Ag. de 2018
No problem, I've put the comment in the answers section so that the question is flagged as answered. As stated, if you provide some data I could try to identify the method used (granted that it's one of the standard ones).

Iniciar sesión para comentar.

 Respuesta aceptada

jonas
jonas el 3 de Ag. de 2018
Editada: jonas el 3 de Ag. de 2018

0 votos

Looks more like a smoothing filter than a fitted equation. Perhaps a moving average.
A moving average filter goes over your data point-by-point and calculates an average within a range (window) from that point. See for example the MATLAB functions movmean and smooth . Your fit does not look parametric in nature as it retains the noise (although damped out). More likely some type of filter.
Try smoothing your data with different methods, using the smooth function, and see if you can reproduce the results. If you provide data, I'd be willing to help.

7 comentarios

Devan Krishnamurthy
Devan Krishnamurthy el 3 de Ag. de 2018
Thank you Jonas, I would really appreciate it. Kindly find the attached sample data ( new revised) in excel spreadsheet format that I am trying to figure out. "Sheet 1" has all data. Kindly have a look at it and let me know. Thanks for your help.
jonas
jonas el 3 de Ag. de 2018
Cannot quite figure it out. Is there some background that one should be aware of? Context? There is a lot of other data in that file that we are not using.
Devan Krishnamurthy
Devan Krishnamurthy el 7 de Ag. de 2018
Editada: Devan Krishnamurthy el 7 de Ag. de 2018
Thank you Jonas for looking at it. Okay I will make it simple now. I have attached a new and simple sample data now. Please find the attached data. Can you please let me know how to perform moving average and also Lorentz fit?. I really appreciate your help.
jonas
jonas el 7 de Ag. de 2018
Editada: jonas el 7 de Ag. de 2018
That's easier. You're going to need this function from fileexchange for the Lorentzian fit ( link ).
%%Import data
data=xlsread('Sample Data_MatLab.xls');
x=data(:,1);
y=data(:,2);
y=y(~isnan(x));
x=x(~isnan(x));
%%Moving average
w=100; %window
ym=smooth(y,w,'moving')
%%Lorentz
yl=lorentzfit(x,y)
figure;
h=plot(x,y,'-b',...
x,ym,'-r',...
x,yl,'-k')
h=legend(h,'data','moving average','Lorentz fit')
Devan Krishnamurthy
Devan Krishnamurthy el 7 de Ag. de 2018
Thanks a bunch. This really helped.
Devan Krishnamurthy
Devan Krishnamurthy el 7 de Ag. de 2018
One more help, can you please help me to calculate FWHM of the fit data?.
jonas
jonas el 7 de Ag. de 2018
Editada: jonas el 7 de Ag. de 2018
Full width of half max? I dont know what that means in this context.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Get Started with Curve Fitting Toolbox en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 3 de Ag. de 2018

Editada:

el 7 de Ag. de 2018

Community Treasure Hunt

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

Start Hunting!

Translated by