How can I solve single nonlinear equation

How can I solve the following equation using Matlab, 6.84e24X^1.8164+9.95E13*X+1=0, Could you please help with syntax?

 Akzeptierte Antwort

Aarti Dwivedi
Aarti Dwivedi am 23 Jul. 2018

0 Stimmen

func = @(x) coeff1*x.^exp1 + coeff2*x.exp2 + b;
x0 = 1; % starting point
roots = fzero(func,x0)
In the above code snippet, you can define your function, choose a starting point and fzero will give you the roots. It is generally a good idea to plot your function to get an idea of what it looks like. You can do that in the following manner:
x_interval = -10:10
fplot(func,x_interval)

3 Kommentare

Thanks for your reply, I have tried the following,
func = @(x) 6.84E24*x^(1.8164) + 9.95E13*x +1;
x0 = 1; % starting point
roots = fzero(func,x0)
with no apparent luck
There is no real-valued solution for
6.84e24X^1.8164+9.95E13*X+1=0
Consider that if X is positive then all of the terms are positive and so the equation cannot be equal to 0. But if X is negative and real-valued, then you have a negative number raised to a fractional power, which is something that is defined as returning a complex result.
Anwar
Anwar am 23 Jul. 2018
Many thanks, Roberson, for highlighting that, I missed that and was trying to solve in different ways.
Thank you once again.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Optimization finden Sie in Hilfe-Center und File Exchange

Gefragt:

am 23 Jul. 2018

Kommentiert:

am 23 Jul. 2018

Community Treasure Hunt

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

Start Hunting!

Translated by