Repeating Matrix Element Until N Times
10 ビュー (過去 30 日間)
古いコメントを表示
Excuse me everyone, I want ask that how to repeating the matrix element like this example :
Example: y = [1; 2; 3; 4] and then I want the output like this (for example until N=7) :

Thanks
2 件のコメント
採用された回答
その他の回答 (1 件)
dpb
2018 年 9 月 23 日
Just one of many possible ways...
L=length(y);
N=7;
x=repmat(y,ceil(N/L),1);
x=x(1:N);
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
