how to get the value of x, from this equation: 0.2exp(x)-x^(0.25) = 0
1 回表示 (過去 30 日間)
古いコメントを表示
% I tried with the below steps:
fun = @(x) (0.2*exp(x)-x.^(0.25));
x0 = [1.5,0];
x = fsolve(fun,x0);
回答 (2 件)
Star Strider
2020 年 10 月 18 日
I do not understand what the problem is:
fun = @(x) (0.2*exp(x)-x.^(0.25));
x0 = [1.5,0];
x = fsolve(fun,x0);
xv = linspace(0,2);
figure
plot(xv, fun(xv))
hold on
plot(x, fun(x), 'rx')
hold off
grid
producing:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/384753/image.png)
This appears to work, and provide the solutions you want.
0 件のコメント
mike Croucher
2020 年 10 月 18 日
That seems to have done the job. I typed your commands and got
x =
1.7492 0.0016
Substituting this into your function gives a vector of results extremely close to 0:
fun(x)
ans =
1.0e-08 *
0.0000 0.1948
Is this what you were hoping for?
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Loops and Conditional Statements についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!