필터 지우기
필터 지우기

How to save 'multiple functions' in new folder?

조회 수: 1 (최근 30일)
Ivan Shorokhov
Ivan Shorokhov 2016년 7월 4일
댓글: Star Strider 2016년 7월 6일
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
Ivan Shorokhov
Ivan Shorokhov 2016년 7월 6일
Thank you for the help!
Star Strider
Star Strider 2016년 7월 6일
My pleasure!

댓글을 달려면 로그인하십시오.

추가 답변 (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