필터 지우기
필터 지우기

How to draw exponential function in matlab

조회 수: 1 (최근 30일)
Chris Lin
Chris Lin 2021년 8월 7일
댓글: Walter Roberson 2021년 8월 11일
Does anyone know how to draw this function f(x)=sin(x). Exp(-lxl) in Matlab?Thanks.

답변 (2개)

Dave B
Dave B 2021년 8월 7일
It seems like you listed a couple of functions, were you looking to plot them separately?
Can plot the functions using fplot
nexttile
fplot(@(x)sin(x))
nexttile
fplot(@(x)exp(-abs(x)))
Or plot values using plot
nexttile
x=linspace(-5,5,100);
plot(x,sin(x))
nexttile
plot(x,exp(-abs(x)))
  댓글 수: 8
Dave B
Dave B 2021년 8월 11일
Hi Chris, can you expand on your question a bit?
Walter Roberson
Walter Roberson 2021년 8월 11일
nexttile means to move to the next sub plot. It is a more modern way of using subplot() that has some advantages.

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


Chris Lin
Chris Lin 2021년 8월 7일
Thanks,How to define the area of X from minus 10 to plus 10
  댓글 수: 5
Chris Lin
Chris Lin 2021년 8월 8일
How to calculate when k=1?
Walter Roberson
Walter Roberson 2021년 8월 8일
format long g
y = @(x,k) sin(x).*exp(-abs(x)).*exp(-i.*k.*x)
y = function_handle with value:
@(x,k)sin(x).*exp(-abs(x)).*exp(-i.*k.*x)
syms x k
area_sym = simplify(int(y(x,k), x, -10, 10))
area_sym = 
area_k_sym = simplify(subs(area_sym,k,(1:8).'))
area_k_sym = 
double(area_k_sym)
ans =
0 - 0.799941726389522i 0 - 0.400020854904531i 0 - 0.141179603605318i 0 - 0.0615282799753523i 0 - 0.0318073184754602i 0 - 0.0184532189656321i 0 - 0.0116468126495915i 0 - 0.00780451904492856i

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

카테고리

Help CenterFile Exchange에서 Axis Labels에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by