Brace Indexing Error

General forum for EasySpin: questions, how to's, etc.
Post Reply
etraore
Newbie
Posts: 1
Joined: Thu Jul 25, 2024 9:22 am

Brace Indexing Error

Post by etraore »

Hello,

I am trying to run esfit but I am coming across this unusual error:

Code: Select all

Brace indexing is not supported for variables of this type.

Error in esfit

Error in XX_Simulation (line 26)
esfit(spc,@pepper,Sys1,SysVary1,Exp,Opt);

Below are the lines of code I'm working with:

Code: Select all

clear, clc, clf

[B,spc] = eprload('XX');
B=B*0.1;

Exp.mwFreq = 9.373199; %GHz
Exp.Range = [min(B), max(B)]; %mT
Exp.nPoints = 2048;
Exp.ModAmp = 0.6; %mT
Exp.Temperature = 30; %Kelvin
Opt.GridSize = 50;

%%
Sys1.g = [6.68 2.9 1.6];
Sys1.gStrain = [0.3 0.2 0.25];
Sys1.Nucs = '59Co';
Sys1.A = [400 100 100]; %MHz
SysVary1.g = [1 1 0.5];
SysVary1.gstraing = [0.3 0.2 0.25];
SysVary1.A = [300 75 75];

[Bfit,spcfit1] = pepper(Sys1,Exp,Opt);
spcfit1 = spcfit1*max(spc)/max(spcfit1)*1;

plot(B,spc,Bfit,spcfit1)
esfit(spc,@pepper,Sys1,SysVary1,Exp,Opt);

As you can see, there are no braces in what I've written so I am unsure what the problem is. All I know is that there is a problem with my esfit code.

Any help would be appreciated!
-E

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

Re: Brace Indexing Error

Post by Stefan Stoll »

Your esfit call is not correct. Use esfit(spc,@pepper,{Sys1,Exp,Opt},{SysVary1});.

Also, SysVary1.gstraing probably should be SysVary1.gStrain.

Post Reply