how to obtain new sequence ,define by length 5 using matlab
3 ビュー (過去 30 日間)
古いコメントを表示
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
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.
回答 (1 件)
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
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Get Started with MATLAB についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!