copy m file from matlab path to current working directory.

3 Ansichten (letzte 30 Tage)
Samir
Samir am 11 Aug. 2016
Beantwortet: Fangjun Jiang am 11 Aug. 2016
I have written some standard functions for my use and stored under matlab path so that I can call it from anywhere. For example I have myfunc.m in matlab path. Now I want to test some modification to it, but I dont want to ruin original file, so I want to copy that file from wherever to current working directory. Is there a way to do this from matlab?
P.S. Dont tell to use cmd/terminal, that I know.

Akzeptierte Antwort

Fangjun Jiang
Fangjun Jiang am 11 Aug. 2016
a=which('myfunc.m');
copyfile(a,'myfunc.m');

Weitere Antworten (0)

Kategorien

Mehr zu Startup and Shutdown finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by