Add x1[n] = exp(−n/4), −4 ≤ n ≤ 8 with x2[n] = cos(πn/4), 0 ≤ n ≤ 12. Plot x1[n], x2[n], and y[n].
조회 수: 3 (최근 30일)
이전 댓글 표시
Hello, I am having a problem with this. I couldn't identify where to start. Thank you.
댓글 수: 0
답변 (1개)
vidyesh
2024년 9월 15일
편집: vidyesh
2024년 9월 15일
Hi Albert,
The starting point would be to decide the period of signals/sample spacings. I am assuming 0.01.
1) define 'n' between -4 and 12 with increments of 0.01.
n = -4:0.01:12;
2) You can then use indexing to set the range of your signals while defining them. For example
% Define your signal, I have assumed x1 is 0 outside of mentioned range
x1 = zeros(1,numel(n));
% Define the function for all values of n
sig1 = exp(-1*n/4);
% Define the range for which function is defined
range = n>=-4 & n<=8;
% Store the values of the signal within the defined range only
x1(range) = sig1(range);
3) Similarly you can plot 'x2' and calculate 'y' and then plot them:
The below documentation pages contain more information regarding the functions that need to be utilized.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Labels and Styling에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!