필터 지우기
필터 지우기

Graph an exponential equation

조회 수: 4 (최근 30일)
Trang To
Trang To 2020년 12월 8일
댓글: Trang To 2020년 12월 8일
Please help me graph this equation
  댓글 수: 2
Ive J
Ive J 2020년 12월 8일
What have you tried so far?
Trang To
Trang To 2020년 12월 8일
x = linspace(0,2*pi,100);
y = exp(1)^(-0.005*x).*cos(0.05*(2000-0.01*x^2)^(0.05))-0.01;
plot(x,y)
I have some error with this

댓글을 달려면 로그인하십시오.

채택된 답변

Ameer Hamza
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 CenterFile Exchange에서 Construction에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by