Effacer les filtres
Effacer les filtres

mix two matrices to create new one

1 vue (au cours des 30 derniers jours)
maryam
maryam le 23 Sep 2015
Modifié(e) : Stephen23 le 27 Juin 2019
hi friends. i have two matrices A and B as follows: A=[A1;A2;....;A10] and B=[B1;B2;....;B10]; i want to create 10 new matrices which defined as: C1=[B1;A2;A3;..;A10],C2=[A1;B2;A3;A4;...;A10],.....,C10=[A1;A2;A3;....A9;B10] would you please help me in coding? thank you in advance

Réponses (1)

Thorsten
Thorsten le 23 Sep 2015
A = rand(10,1);
B = 10*rand(10,1);
C = repmat(A, 1, 10);
C(1:11:10*10) = B;
Ci is then C(:,i).

Catégories

En savoir plus sur Numeric Types dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by