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 Center および File ExchangeLabels and Styling についてさらに検索

タグ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by