Borrar filtros
Borrar filtros

How to save 'multiple functions' in new folder?

1 visualización (últimos 30 días)
Ivan Shorokhov
Ivan Shorokhov el 4 de Jul. de 2016
Comentada: Star Strider el 6 de Jul. de 2016
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 comentarios
John D'Errico
John D'Errico el 4 de Jul. de 2016
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 el 4 de Jul. de 2016
Editada: Ivan Shorokhov el 4 de Jul. de 2016
So I'm wondering, if there are no any other way around?

Iniciar sesión para comentar.

Respuesta aceptada

Star Strider
Star Strider el 4 de Jul. de 2016
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 comentarios
Ivan Shorokhov
Ivan Shorokhov el 6 de Jul. de 2016
Thank you for the help!
Star Strider
Star Strider el 6 de Jul. de 2016
My pleasure!

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre MATLAB en Help Center y File Exchange.

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by