Effacer les filtres
Effacer les filtres

How to make a matrix from a vector?

1 vue (au cours des 30 derniers jours)
Lev Mihailov
Lev Mihailov le 21 Fév 2022
Réponse apportée : KSSV le 21 Fév 2022
There is a simple vector, is it possible to make a matrix out of it somehow?
v=[ 1 2 3 4];
m=[[ 1 2 3 4],[ 1 2 3 4],[ 1 2 3 4],[ 1 2 3 4],[ 1 2 3 4],[ 1 2 3 4]] ; % you need to get a 6x4 matrix

Réponses (1)

KSSV
KSSV le 21 Fév 2022
v = [1 2 3 4] ;
iwant = repmat(v,6,1)
iwant = 6×4
1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4

Catégories

En savoir plus sur Multidimensional Arrays dans Help Center et File Exchange

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by