How can I make the following expression changes dynamically?

3 vues (au cours des 30 derniers jours)
Ahmed Elkady
Ahmed Elkady le 31 Juil 2012
Modifié(e) : Stephen23 le 25 Juin 2019
How can I make the following expression changes dynamically?
VariableX = importdata ('FilenameX.out');
where, everything is constant but the "X" is a integer number that changes from 1 to 5
for example: hello4 = impotdata ('file4.out');

Réponse acceptée

Azzi Abdelmalek
Azzi Abdelmalek le 31 Juil 2012
Modifié(e) : Azzi Abdelmalek le 31 Juil 2012
for k=1:4
Filename='exemple', %exemple
file=strcat(Filename,num2str(k),'.out')
evalc(strcat('Variable',num2str(k),' = importdata(''',file,''')'));
end
  3 commentaires
Azzi Abdelmalek
Azzi Abdelmalek le 31 Juil 2012
Modifié(e) : Azzi Abdelmalek le 12 Sep 2012
ok , I will fix it
Ahmed Elkady
Ahmed Elkady le 31 Juil 2012
Yes .. it works... much appreciate your effort .. Thanks

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Dynamic System Models 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