How do I go about plotting the following function?
조회 수: 1 (최근 30일)
이전 댓글 표시
The function I want to plot is x[n] = \delta[n] - \delta[n-a] where a is just a number.
I know about plotting the impulse function on it's own but this doesn't make any sense to me.
Any and all help is appreciated.
답변 (1개)
John Doe
2019년 10월 9일
편집: John Doe
2019년 10월 10일
I've used random numbers.
a = 5
n = [1:1:50]';
delta = 10;
x(n,1) = delta - (delta*(n-a))
plot(x,n)
Alternatively, you could leave n as it is without transposing and plot per the below:
a = 5
n = 1:1:50;
delta = 10;
x(n,1) = delta - (delta*(n-a))
plot(x(:,1),n(1,:))
It doesn't make much odds.
참고 항목
카테고리
Help Center 및 File Exchange에서 Formatting and Annotation에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!