How do I repeat a column vector to make into one longer column vector?

I have a column vector that has 24 values that I want to repeat 30 times into a column vector that has 720 values. How do I do this?

 採用された回答

madhan ravi
madhan ravi 2019 年 2 月 12 日

0 投票

repmat(yourvector,30,1)
%or
repelem(yourvector,30,1)
% choose which suits you

その他の回答 (1 件)

Geoff Hayes
Geoff Hayes 2019 年 2 月 12 日

0 投票

Georgina - try using repmat as
z = rand(24, 1);
y = repmat(z, 30, 1);

Community Treasure Hunt

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

Start Hunting!

Translated by