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 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!