I am interested to run optimization (lsqnonlin) in the command line itself without calling or creating a ☆.m file!
clc; clear allk = 1:10;fun =@(x) ( 2 + 2*k-exp(k*x(1))-exp(k*x(2)) );% Next, invoke an optimization routine.
x0 = [0.3 0.4] % Starting guess
[x,resnorm] = lsqnonlin ( fun, x0 );
Best Answer