Question in creating variables.
4 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
How do i create variables in each iteration? like x_1 to x_n and then assigning values/arrays to each of them.
4 commentaires
Réponse acceptée
Matt J
le 30 Sep 2012
I would do something like this:
labels=arrayfun(@(i) ['A' num2str(i)], 1:3,'uni',0).';
data=cellfun(@(a) num2str(a), num2cell(A),'uni',0);
result=[labels, data]
result =
'A1' '3' '5' '6'
'A2' '5' '3' '4'
'A3' '6' '7' '9'
Plus de réponses (0)
Voir également
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!