Error when solving system of equations with fsolve

조회 수: 2 (최근 30일)
Giorgos Papakonstantinou
Giorgos Papakonstantinou 2013년 5월 13일
I have the following system to solve:
syms x
f = @(x) [(2*x(1).^2-2.*x(2).^3+1)/4; (-x(1).^4-4*x(2).^4+8.*x(2)+4)/12];
R = fsolve(f,[0 0]);
Instead of writing f as suggested above I wanted to write f as the shown below:
f1=(2*x(1).^2-2.*x(2).^3+1)/4;
f2=(-x(1).^4-4*x(2).^4+8.*x(2)+4)/12;
f=[f1;f2];
when I insert the command
R = fsolve(f,[0 0]);
I get the following error.
Error using mupadmex
Error in MuPAD command: Index exceeds matrix dimensions.
Error in sym/subsref (line 1389)
B = mupadmex('symobj::subsref',A.s,inds{:});

채택된 답변

Matt J
Matt J 2013년 5월 13일
You cannot use FSOLVE to solve symbolic equations. You would use SOLVE instead.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Numeric Solvers에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by