Results 1 to 2 of 2

Thread: Help with lsqcurvefit

  1. #1
    Nov 2009

    Help with lsqcurvefit

    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,


    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.
    Follow Math Help Forum on Facebook and Google+

  2. #2
    Member Jskid's Avatar
    Jul 2010
    There is a problem with the way you are defining the anonymous function. Read this Anonymous Functions :: Types of Functions (MATLABŪ)
    Follow Math Help Forum on Facebook and Google+

Search Tags

/mathhelpforum @mathhelpforum