repeat an array (a signal) over a specific period

조회 수: 11 (최근 30일)
David De Querol
David De Querol 2022년 5월 12일
댓글: David De Querol 2022년 5월 13일
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

채택된 답변

Fangjun Jiang
Fangjun Jiang 2022년 5월 12일
new_phi=repmat(phi,1,200)
  댓글 수: 1
David De Querol
David De Querol 2022년 5월 13일
changed the factor to 2000, as the array phi_card is actually 200001x1, but yes, you solved it pretty simple. Thank you :)

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Multidimensional Arrays에 대해 자세히 알아보기

제품


릴리스

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by