Hello, everyone.
Here is a question. I've tried to solve some nonlinear equations (not simultaneous equations) of multi-dimensional array form by R2012a fsolve and then seen error message.
the following is the simplified code for this question.
x0=ones(3,2,2)b(:,:,1)=[2 3;4 6;1 9];b(:,:,2)=2.*[2 3;4 6;1 9];f=@(x)x.^3+b.*x+8fsolve(f,x0)
and the error messages are…
Error using .* Matrix dimensions must agree.
Error in @(x)x.^3+b.*x+8
Error in C:\Program Files\MATLAB\R2012a\toolbox\shared\optimlib\finDiffEvalAndChkErr.p>finDiffEvalAndChkErr (line 26)
Error in C:\Program Files\MATLAB\R2012a\toolbox\shared\optimlib\finitedifferences.p>finitedifferences (line 128)
Error in trustnleqn (line 97) [JACfindiff,~,~,numFDfevals] = finitedifferences(x,funfcn{3},[],[],[],Fvec,[],[], …
Error in fsolve (line 397) [x,FVAL,JACOB,EXITFLAG,OUTPUT,msgData]=…
plz, let me know where the problems are.
best regards
S. R. Huh
Best Answer