Effacer les filtres
Effacer les filtres

Managing directory paths

4 vues (au cours des 30 derniers jours)
William
William le 15 Mar 2012
I want to shorten a directory path. What I'm looking to do:
Use pwd to return the current folder (which in this example is 'c:\Asset_Allocation\Matlab_codes').
Shorten this path by one folder, i.e. I want to return 'c:\Asset_Allocation'.
What's the simplest way to do so?

Réponse acceptée

Jan
Jan le 15 Mar 2012
S = 'c:\Asset_Allocation\Matlab_codes';
P = fileparts(S)

Plus de réponses (0)

Catégories

En savoir plus sur File Operations dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by