How can I make the following expression changes dynamically?

3 ビュー (過去 30 日間)
Ahmed Elkady
Ahmed Elkady 2012 年 7 月 31 日
編集済み: Stephen23 2019 年 6 月 25 日
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');

採用された回答

Azzi Abdelmalek
Azzi Abdelmalek 2012 年 7 月 31 日
編集済み: Azzi Abdelmalek 2012 年 7 月 31 日
for k=1:4
Filename='exemple', %exemple
file=strcat(Filename,num2str(k),'.out')
evalc(strcat('Variable',num2str(k),' = importdata(''',file,''')'));
end
  3 件のコメント
Azzi Abdelmalek
Azzi Abdelmalek 2012 年 7 月 31 日
編集済み: Azzi Abdelmalek 2012 年 9 月 12 日
ok , I will fix it
Ahmed Elkady
Ahmed Elkady 2012 年 7 月 31 日
Yes .. it works... much appreciate your effort .. Thanks

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeDynamic System Models についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by