Solving an equation on MATLAB

Hi everybody. I have an equation like this:
(5+x)^2/15+(x-4)^2/10=100
Can MATLAB solve this equation directly? If it can not do this, how can i achieve this problem?
Thanks

 采纳的回答

Rahul K
Rahul K 2017-2-19

0 个投票

Can be solved using the symbolic toolbox, https://au.mathworks.com/help/symbolic/solve.html.

4 个评论

How can i add this toolbox on my MATLAB?
You can use fzero and a a loop to get (and plot) both roots:
f = @(x) (5+x).^2/15+(x-4).^2/10 - 100;
x0 = [-100 100];
for k1 = 1:length(x0);
rts(k1) = fzero(f, x0(k1))
end
x = linspace(-100, 100);
figure(1)
plot(x, f(x),'-m', rts, f(rts), 'pg')
grid
Star Strider you are my HERO. Thanks a lot.
As always, my pleasure!

请先登录,再进行评论。

更多回答(0 个)

类别

帮助中心File Exchange 中查找有关 Numerical Integration and Differential Equations 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by