Effacer les filtres
Effacer les filtres

Replacing arrays within a matrix

2 vues (au cours des 30 derniers jours)
Rob
Rob le 27 Fév 2018
Réponse apportée : KSSV le 27 Fév 2018
Really quick question.
How do I replace in one command for instance, in a matrix of 4x4, the first two rows by a vector v, and the other two rows by a vector u?

Réponses (1)

KSSV
KSSV le 27 Fév 2018
As you are replacing all the elements of the matrix..why you want to go for replace? You create a different matrix itself.....
u = rand(1,4) ;
v = rand(1,4) ;
iwant = [u ; u ;v ;v ]

Catégories

En savoir plus sur Matrix Indexing 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