当前位置: 动力学知识库 > 问答 > 编程问答 >

save - Matlab - Saving multiple variables from workspace in separate text files

问题描述:

How do I save multiple variables from workspace in separate text files with file name as the corresponding variable name?

网友答案:

You could use something like this:

vars = who;
for k = 1:numel(vars)
    save(vars{k},vars{k});
end

The who function grabs all of the variables in your current workspace and, in practice, could be replaced by a cell array of strings of just the variable names that you would like to save.

分享给朋友:
您可能感兴趣的文章:
随机阅读: