Error when solving system of equations with fsolve
2 次查看(过去 30 天)
显示 更早的评论
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{:});
0 个评论
采纳的回答
Matt J
2013-5-13
You cannot use FSOLVE to solve symbolic equations. You would use SOLVE instead.
0 个评论
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!