how to obtain new sequence ,define by length 5 using matlab

3 ビュー (過去 30 日間)
judith olumeko
judith olumeko 2022 年 2 月 16 日
回答済み: Abhishek Chakram 2023 年 10 月 5 日
For the following sequences, defined for length=5
• a[n] = [1 2 4 − 9 1]
• b[n] = [2 − 1 3 3 0]
Obtain the new sequences:
• c[n] = 2.a[n].b[n]
• d[n] = a[n] + b[n]
• e[n] = 0.5.a[n]
  2 件のコメント
Jan
Jan 2022 年 2 月 16 日
This does not look like Matlab. I cannot guess reliably, what "[1 2 4 − 9 1] " means. Is this:
a = [1, 2, 3, -9, 1]
What do the dots mean in "2.a[n].b[n]" ?
The text sounds like a homework. Is this the case? Then please show, what you have tried so far.
Walter Roberson
Walter Roberson 2022 年 2 月 16 日
I think the dot is element multiplication

サインインしてコメントする。

回答 (1 件)

Abhishek Chakram
Abhishek Chakram 2023 年 10 月 5 日
Hi Judith olumeko,
It is my understanding that you want to generate new sequences from the array “a” and “b”. Here is how you can achieve the same:
% Define the sequences
a = [1, 2, 4, -9, 1];
b = [2, -1, 3, 3, 0];
% Calculate c[n]
c = 2 * a .* b;
% Calculate d[n]
d = a + b;
% Calculate e[n]
e = 0.5 * a;
% Display the new sequences
disp(c);
disp(d);
disp(e);
Hope this answers your question.
Best Regards,
Abhishek Chakram

カテゴリ

Help Center および File ExchangeGet Started with MATLAB についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by