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

5 次查看(过去 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
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
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 CenterFile Exchange 中查找有关 Get Started with MATLAB 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by