Okay so this is my code, I do not see an error. The problem seems to be in the fminsearch function though.
function f=fSSR(a,xm,ym)yp=a(1)*xm.^a(2);f=sum((ym-yp).^2);clear%15.22
%Nonlinear regression
x=[.5 1 2 3 4];y=[10.4 5.8 3.3 2.4 2];a=fminsearch(@fSSR,[1,1],[],x,y)v=[0:100];F=a(1)*v^a(2);plot(F)
Best Answer