How to save 'multiple functions' in new folder?

1 次查看(过去 30 天)
Hello,
I have used the following code to Identify Program Dependencies:
[fList,pList] = matlab.codetools.requiredFilesAndProducts('myFun.m');
Next I would like to save the output functions from fList into new folder.
I have tried the following code:
[fList,pList] = matlab.codetools.requiredFilesAndProducts('myFun.m');
fList = fList';
for n = 1:length(fList)
save(fList{n,1});
% copyfile('fList{n,1}','C:\Users\...\New_folder');
end
But it didn't work.
  2 个评论
John D'Errico
John D'Errico 2016-7-4
Copying m-files around programmatically, so that you end up with multiple copies is asking for buggy code, that will be impossible to manage. Good luck, but expect it to create pure hell for you.
Ivan Shorokhov
Ivan Shorokhov 2016-7-4
编辑:Ivan Shorokhov 2016-7-4
So I'm wondering, if there are no any other way around?

请先登录,再进行评论。

采纳的回答

Star Strider
Star Strider 2016-7-4
I would save the entire cell array as one variable, to a single .mat file.
Example:
save('MyFun_Dependendency_Files.mat', 'fList');
or something similar. The loop is not necessary, and will likely caus problems for you.
  8 个评论

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 MATLAB 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by