Exporting data
Hello, I have performed a least-squares fitting successfully but I am not able to export simulated spectra in ascii. All I get is an experimental spectrum. I have studied exporting section in documentation. There is my code below. I would appreciate any help.
clear,clc
[B,spc] = textread('D:\Dominika sym EPR\1,4dirad119K.txt','%f %f');
plot(B,spc)
%%
Sys = struct('S',1,'g',2.00254,'HStrain',[51.5527 158.536 87.7031],'D',[190.928, -4.24281], 'weight',1);
Sys1 = struct('S',1/2,'g',2.00338,'lwpp',[0.602027 0.34], 'weight', 0.0354022);
Exp.mwFreq = 9.644;
Exp.Range = [min(B/10) max(B/10)];
Exp.nPoints=length(B);
FitOpt.Scaling='lsq0';
FitOpt.Method='levmar fcn';
Opt.Method='perturb';
FitOpt.TolFun=1e-7;
FiOpt.TolStep=1e-8;
Vary.g=(0.01);
Vary.HStrain=[50 50 87];
Vary.D = [80 30];
Vary1.g=(0.01);
Vary1.lwpp = [0.03 .02];
Vary1.weight = 1;
esfit('pepper',spc,{Sys,Sys1},{Vary, Vary1},Exp,Opt,FitOpt);
%%
plot(fit1.fitSpec);
eprsave('fit1',B,spc,'EasySpin simulation');
%%
data = [B(:) spc(:)];
save('fit1.txt','data','-ascii');