问题描述:

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.

相关阅读:
Top