Simultaneous fitting with new easy spin syntax

General forum for EasySpin: questions, how to's, etc.
Post Reply
RadioGlass
Newbie
Posts: 1
Joined: Tue Sep 13, 2022 4:50 am

Simultaneous fitting with new easy spin syntax

Post 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

Stefan Stoll
EasySpin Creator
Posts: 1108
Joined: Mon Jul 21, 2014 10:11 pm
Location: University of Washington

Re: Simultaneous fitting with new easy spin syntax

Post by Stefan Stoll »

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

Post Reply