How can I make the following expression changes dynamically?

 采纳的回答

for k=1:4
Filename='exemple', %exemple
file=strcat(Filename,num2str(k),'.out')
evalc(strcat('Variable',num2str(k),' = importdata(''',file,''')'));
end

3 个评论

Thanks for response but this solves the right hand side of the expression.
Note that I need the "X" in "VariableX" to change too
Yes .. it works... much appreciate your effort .. Thanks

请先登录,再进行评论。

更多回答(0 个)

类别

在 帮助中心 和 File Exchange 中查找有关 Just for fun 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by