repeat an array (a signal) over a specific period

Dear community,
I have the following values:
  • phi_card is an array 20001x1 double
  • phi is 1x100 double, that starts on -3.14 and ends on +3.14.
which can be shown in the following screenshot image:
The goal is to extend the (red) signal as long as the (blue) signal. My first guess is to do a for loop as follows:
for i=1:length(phi_card)
...
end
but then my low skills of programming in matlab gets me struggle how to continue. How would you do it? Can you help me?
Thank you,
David

 Respuesta aceptada

Fangjun Jiang
Fangjun Jiang el 12 de Mayo de 2022

0 votos

new_phi=repmat(phi,1,200)

1 comentario

changed the factor to 2000, as the array phi_card is actually 200001x1, but yes, you solved it pretty simple. Thank you :)

Iniciar sesión para comentar.

Más respuestas (0)

Productos

Versión

R2020b

Preguntada:

el 12 de Mayo de 2022

Comentada:

el 13 de Mayo de 2022

Community Treasure Hunt

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

Start Hunting!

Translated by