How to draw exponential function in matlab
조회 수: 1 (최근 30일)
이전 댓글 표시
Does anyone know how to draw this function f(x)=sin(x). Exp(-lxl) in Matlab?Thanks.
댓글 수: 0
답변 (2개)
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
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
2021년 8월 7일
댓글 수: 5
Walter Roberson
2021년 8월 8일
format long g
y = @(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_k_sym = simplify(subs(area_sym,k,(1:8).'))
double(area_k_sym)
참고 항목
카테고리
Help Center 및 File Exchange에서 Axis Labels에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!