Thank you,
I currently have these 2 scripts
1)fn.m
function deltaR1 = fn(E,G)
deltaR1=1/(E-1.18-1i*G);
and 2) fitting.m
E=E1;%E1 and DR1 are the names of my arrays
DR=DR1;
ft=lsqcurvefit('fn(E,G)');
f=fit(E,DR,ft);
A=coeffvalues(f);
fplot(f)
Matlab returns this error:
Error using lsqcurvefit (line 167) The input to LSQCURVEFIT should be either a structure with valid fields or consist of at least four arguments.
Error in fitting (line 6) ft=lsqcurvefit('fn,E,G');