필터 지우기
필터 지우기

How can I Repeat time data for a number of days

조회 수: 1 (최근 30일)
Mohammad Sayeed
Mohammad Sayeed 2015년 3월 26일
댓글: Star Strider 2015년 3월 30일
Hi Guys, I have generated a column vector of one minutes interval time (So I have 1440 rows of time). Now I need repeat the times for 2490 days as I have 2490 trading days in my data set. So my output will be a column that contains 1440 time (from 12.00 AM to 11.59 PM) 2490 times. So total length of the column will be 1440*2490=3585600. Anyone can help plz?

채택된 답변

Star Strider
Star Strider 2015년 3월 26일
Use repmat:
T = [1:1440]'; % Column Vector Of Minutes
Days = 2490; % Days To Replicate
Tv = repmat(T, Days, 1); % Time Vector (3585600x1)
  댓글 수: 7
Mohammad Sayeed
Mohammad Sayeed 2015년 3월 30일
Thank you @Star. It is indeed very helpful. Thank you again.
Star Strider
Star Strider 2015년 3월 30일
Again, my pleasure.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Dates and Time에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by