Concatenating matrix with itself x number of times

4 ビュー (過去 30 日間)
Aditya Palsule
Aditya Palsule 2015 年 9 月 1 日
コメント済み: Aditya Palsule 2015 年 9 月 1 日
I have t=[1 0 0;0 1 0; 0 0 1] size(t) is (3 3)
i need to make t with size of (x,3) where x is user input while element in t are repeated
eg if x=2 then t=[t;t]
if x=3 then t=[t;t;t]

採用された回答

Titus Edelhofer
Titus Edelhofer 2015 年 9 月 1 日
Hi,
use the function repmat:
repmat(t, x, 1)
Titus
  1 件のコメント
Aditya Palsule
Aditya Palsule 2015 年 9 月 1 日
thanks a lot was a lot easier than I expected.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeCreating and Concatenating Matrices についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by