Page 1 of 1

Multi-component esfit with different functions possible?

Posted: Thu Mar 10, 2016 10:49 am
by warly
Hello,
is it possible to simulate a spectrum with multiple components with esfit,
where I need to use different functions for the different components?
For example for the more immobile component chili and for the fast component garlic.
I guess I have to write a user-defined simulation function for this, but I wasn't successful.
Could somebody give me a hint how to write such a function?

Thanks & regards!

Re: Multi-component esfit with different functions possible?

Posted: Thu Mar 10, 2016 6:45 pm
by joscha_nehrkorn

Code: Select all

function y = myfit(Sys,Exp,Opt)
if nargin<3, Opt=struct(); end
Sys_garlic = Sys;
Sys_garlic.g = Sys.g_garlic;
Sys_garlic.logtcorr = Sys.logtcorr_garlic;
Sys_chili = Sys;
Sys_chili.g = Sys.g_chili;
Sys_chili.logtcorr = Sys.logtcorr_chili;
yg = garlic(Sys_garlic,Exp,Opt);
yc = chili(Sys_chili,Exp,Opt);
y = yg +yc;
should do it when only g and logtcorr should be different, but I guess it is clear how to expand this.
It is a quick and dirty code, but should do your job.