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

3 visualizaciones (últimos 30 días)
judith olumeko
judith olumeko el 16 de Feb. de 2022
Respondida: Abhishek Chakram el 5 de Oct. de 2023
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 comentarios
Jan
Jan el 16 de Feb. de 2022
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 el 16 de Feb. de 2022
I think the dot is element multiplication

Iniciar sesión para comentar.

Respuestas (1)

Abhishek Chakram
Abhishek Chakram el 5 de Oct. de 2023
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

Categorías

Más información sobre Get Started with MATLAB en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by