Add directory to search path
古いコメントを表示
Hello,
Some of my scripts use data from outside the working directory. I specify the data file by entering the entire path.
This works fine, however I'm forced to switch a lot between workstations. Those workstations have different names for the hard drive, which means I have to manually change all path specifiers every time I change PC's.
Since my data is always in the folder that is one down on the directory tree (i.e. the data is in the same folder as the folders containing my scrips are), I hope there is a way to make my scripts station independent.
Thanks for any tips.
採用された回答
その他の回答 (1 件)
Jiro Doke
2011 年 1 月 31 日
prevDir = fileparts(pwd)
2 件のコメント
Michelle Hirsch
2011 年 1 月 31 日
You are fast, Jiro! Snuck this in while I was crafting my detailed, elegant answer! :)
Erik de Boer
2011 年 1 月 31 日
カテゴリ
ヘルプ センター および File Exchange で File Operations についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!