Error when solving system of equations with fsolve

1 view (last 30 days)
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{:});

Accepted Answer

Matt J
Matt J on 13 May 2013
You cannot use FSOLVE to solve symbolic equations. You would use SOLVE instead.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!