I'm newbie on matlab and I want to use lsqcurvefit to adjut 2 parameters, but this function is giving me a error that I coudn't solve.
My function is,
VEc=Vredm.*(((1-x).*K(1,1).*vass(1,1).*(X111-A1))+(x.*K(2,1).*vass(2,1).*(Y111-A2))+(((1-x).*KAB.*VassAB.*Y111.*(1-K(1,1).*X111))./((V(2,1)/V(1,1)).*(1-K(2,1).*Y111)+KAB.*Y111)));
Vredm, x, X111, Y111 - 23 values each variable
K, vass, V have - 2 values each variable
A1, A2 - 1 value each variable
KAB, VassAB - adjustable parameters
When I give some values for KAB and VassAB, VEc runs OK, but when I use it in lsqcurvefit it give me this error,
Error using ==> times
Matrix dimensions must agree.
Here is my lsqcurvefit function,
[KAB,VassAB]=lsqcurvefit(@(KAB,VassAB) Vredm.*(((1-x).*K(1,1).*vass(1,1).*(X111-A1))+(x.*K(2,1).*vass(2,1).*(Y111-A2))+(((1-x).*KAB.*VassAB.*Y111.*(1-K(1,1).*X111))./((V(2,1)/V(1,1)).*(1-K(2,1).*Y111)+KAB.*Y111))),[1,1],x,ve);
Please somebody could help me with this function?
Thanks in advance.


LinkBack URL
About LinkBacks