Prev: Plotting piecewise function
Next: Matlab Compiler
From: Vyjayanthi A on 13 Mar 2010 10:22 Hi What does the below error mean ??? Subscripted assignment dimension mismatch. Error in ==> fminsearch at 175 fv(:,1) = funfcn(x,varargin{:}); I am trying to solve 6 unknowns in 6 equations using fminsearch, and every time I solve these functions it is displaying the 6 unknown variables as the initial guess and not the original answers. Any kind of help is highly appreciated. Thanks
From: John D'Errico on 13 Mar 2010 12:44 "Vyjayanthi A" <vinzav(a)gmail.com> wrote in message <hngait$40o$1(a)fred.mathworks.com>... > Hi > What does the below error mean > ??? Subscripted assignment dimension mismatch. > > Error in ==> fminsearch at 175 > fv(:,1) = funfcn(x,varargin{:}); > > I am trying to solve 6 unknowns in 6 equations using fminsearch, and every time I solve these functions it is displaying the 6 unknown variables as the initial guess and not the original answers. > Fminsearch is NOT an equation solver. It is NOT designed to solve a system of equations in multiple unknowns. It is designed to minimize a SINGLE function of multiple variables. Use the proper tool for the problem. Fsolve from the optimization toolbox does this. If you do not have the optimization toolbox, then you must formulate the problem as a minimization problem. Formulate it as the sum of squares of the residuals to your 6 equations. Then fminsearch will in theory be able to solve your problem. Note that 6 variables tends to be on the large size for fminsearch to work happily, but it should work. John
|
Pages: 1 Prev: Plotting piecewise function Next: Matlab Compiler |