MATLAB: The matrix is not square, although i think it is

functionleast squaresmatrices

I have set the following least squares method up quickly. I know i am using a nonlinear technique to solve a linear problem, however i just wanted to get it working, before i choose a linear method but aparently my matrices are not square:
i = [1 2 3 4 5];
ti = [2 5 7 11 14];
Estimates3=fminsearch(@functionnumbers,1,options,T0,theta_f);
and the function code
function fnumbers = functionnumbers(params3,i,ti)
k = params3;
v0 = 1 + (k/2)*ti(1)^2/ti(1)
fnumbers = sum(ti.^2*(i/ti-(v0-(k/2)*ti))^2);
cheers

Best Answer

fminsearch() accepts at most 3 inputs, and the function passed to it must accept a single input. See http://www.mathworks.com/help/techdoc/ref/fminsearch.html
For information on how to do this properly, please read this
Related Question