Extracting name of variables from cell array
Afficher commentaires plus anciens
Dear All,
I have a cell array combin which contains all possible combinations of 4 elements ('A';'B';'C';'D') taken 3 at a time.
combin =
'A' 'B' 'C'
'A' 'B' 'D'
'A' 'C' 'D'
'B' 'C' 'D'
coef = ['A';'B';'C';'D'];
coef = cellstr(coef);
combin = nchoosek(coef,3)
Each letter is also the variable name of a random number vector:
A = rand(10,1); B = rand(10,1); C = rand(10,1); D = rand(10,1);
I would like to obtain a matrix made of vectors A,B,C or D for each row of combin. For instance,
mod1 = [A B C];
...
mod4 = [B C D];
Any help would be highly appreciated.
Best, S.
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Entering Commands dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!