How can I make the following expression changes dynamically?
4 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Ahmed Elkady
il 31 Lug 2012
Modificato: Stephen23
il 25 Giu 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');
Risposta accettata
Azzi Abdelmalek
il 31 Lug 2012
Modificato: Azzi Abdelmalek
il 31 Lug 2012
for k=1:4
Filename='exemple', %exemple
file=strcat(Filename,num2str(k),'.out')
evalc(strcat('Variable',num2str(k),' = importdata(''',file,''')'));
end
3 Commenti
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Dynamic System Models in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!