Graph an exponential equation
2 ビュー (過去 30 日間)
古いコメントを表示
Please help me graph this equation
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/454823/image.png)
2 件のコメント
採用された回答
Ameer Hamza
2020 年 12 月 8 日
編集済み: Ameer Hamza
2020 年 12 月 8 日
You can use fsolve() for such problems. For example
fun = @(x) exp(-0.005*x).*cos(0.05*(2000-0.01*x.^2).^(0.05))-0.01
sol = fsolve(fun, rand())
Note that, the code you included in your question contain exp(1)^(-0.005*x). That is very inefficient.
If you just want to graph it then try
x = linspace(0,2*pi,100);
y = exp(-0.005*x).*cos(0.05*(2000-0.01*x.^2).^(0.05))-0.01;
plot(x,y)
Note that I have replaced * with .* and ^ with .^. Read about element-wise operators here: https://www.mathworks.com/help/matlab/matlab_prog/array-vs-matrix-operations.html
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Graph and Network Algorithms についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!