Page 1 of 1

Simultaneous fitting with new easy spin syntax

Posted: Tue Sep 13, 2022 5:03 am
by RadioGlass

Hi
I've been trying to use instructions from an old forum post viewtopic.php?p=361 to simultaneously fit two sets of EPR spectra collected from the same sample at X and Q band, and I keep running into this error "Error using esfit First argument must be numeric experimental data in the form of a vector". Does anyone know an easy way of setting up the new version of esfit simultaneously fit two different spectra?
I've included the code I'm trying to run below.

ExpQ.mwFreq = Exp.mwFreqQ;
ExpQ.Range = Exp.RangeQ;
ExpQ.nPoints = 2000;
yQ = pepper(Sys,ExpQ);

ExpX.mwFreq = Exp.mwFreqX;
ExpX.Range = Exp.RangeX;
ExpX.nPoints = 2000;
yX = pepper(Sys,ExpX);
scale = 1;

esfit([Xdata Qdata],@simulfit,{Sys,Exp},Vary)

function y = simulfit(Sys,Exp)
y = [yQ(:); scale*yX(:)];
end


Re: Simultaneous fitting with new easy spin syntax

Posted: Wed Sep 21, 2022 9:21 pm
by Stefan Stoll

Maybe the size of your data array is not correct. Try [Xdata(:); Qdata(:)] instead of `[Xdata Qdata]'.