I am trying to do a non linear regression to find the constants Is and n with the least square curve fitting.This is the formula Is(exp(1).^(V/26.*n))
And this is my code
fun = @(n,Is)Is(exp(1).^(V/26.*n));
x0 = [0,14];
x = lsqcurvefit(fun,x0,V,I)
It retruns the following
Matrix dimensions must agree.
Error in @(n,Is)Is(exp(1).^(V/26.*n))
Error in lsqcurvefit (line 202) initVals.F = feval(funfcn_x_xdata{3},xCurrent,XDATA,varargin{:});
Caused by: Failure in initial objective function evaluation. LSQCURVEFIT cannot continue.