MATLAB: Error when solving system of equations with fsolve

equationfsolvenonlinearsystem of equations

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{:});

Best Answer

You cannot use FSOLVE to solve symbolic equations. You would use SOLVE instead.
Related Question