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일)
Albert
Albert 2022년 10월 8일
편집: vidyesh 2024년 9월 15일
Hello, I am having a problem with this. I couldn't identify where to start. Thank you.

답변 (1개)

vidyesh
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.

카테고리

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

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by