Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
ベクトルを繰り返して拡張する方法はありますか?
>v = [1 2]; >v10 = v x 5; %x represents some function. Something like "1 2" x 5 in perl
その場合、v10 は次のようになります。
>v10 1 2 1 2 1 2 1 2 1 2
これは [1 2] だけでなく、一般的なケースでも機能するはずです。
お探しの機能はrepmat().
repmat()
v10 = repmat(v, 1, 5)