Concatenating matrix with itself x number of times

4 次查看(过去 30 天)
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

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Creating and Concatenating Matrices 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by