Page 1 of 1

Brace Indexing Error

Posted: Thu Jul 25, 2024 10:15 am
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


Re: Brace Indexing Error

Posted: Tue Jul 30, 2024 11:49 am
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.