Effacer les filtres
Effacer les filtres

Concatenating matrix with itself x number of times

4 vues (au cours des 30 derniers jours)
Aditya Palsule
Aditya Palsule le 1 Sep 2015
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]

Réponse acceptée

Titus Edelhofer
Titus Edelhofer le 1 Sep 2015
Hi,
use the function repmat:
repmat(t, x, 1)
Titus
  1 commentaire
Aditya Palsule
Aditya Palsule le 1 Sep 2015
thanks a lot was a lot easier than I expected.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Creating and Concatenating Matrices dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by