find_containing_fol​der

Versione 1.1.0.0 (1,17 KB) da Rik
Find the full path of your calling function
24 download
Aggiornato 23 mar 2017

Visualizza la licenza

If you have a complex set of functions that are synced over different systems (or run from a USB) it can still be necessary to interact with subfolders. This function implements one of several options to find the full path of the calling function, so you can still create/load files in subfolders not on the Matlab path.
Tested to work on Matlab and Octave. This code should be OS-independent and release-independent.
(I personally use this as a subfunction of a function that returns several folder names. The goal of that file is to allow me to move around folders, without having to check all my code to see if anything breaks.)

Update to v1.1:
Returns the current working directory as output when called from the command window or 'run section' (instead of returning an error).

Cita come

Rik (2024). find_containing_folder (https://www.mathworks.com/matlabcentral/fileexchange/61475-find_containing_folder), MATLAB Central File Exchange. Recuperato .

Compatibilità della release di MATLAB
Creato con R2016b
Compatibile con qualsiasi release
Compatibilità della piattaforma
Windows macOS Linux
Categorie
Scopri di più su File Operations in Help Center e MATLAB Answers

Community Treasure Hunt

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

Start Hunting!
Versione Pubblicato Note della release
1.1.0.0

Returns the current working directory as output when called from the command window or 'run section' (instead of returning an error).

1.0.0.0