Revision 495
(checked in by cbc, 12 years ago)
|
Initial import of Stark code.
|
Line | |
---|
1 |
function setdef(theFunction) |
---|
2 |
|
---|
3 |
% setdef -- Switch to directory of a function. |
---|
4 |
% setdef(theFunction) switches to the directory |
---|
5 |
% that contains theFunction. |
---|
6 |
% setdef (no argument) displays pwd. |
---|
7 |
|
---|
8 |
% Copyright (C) 1996 Dr. Charles R. Denham, ZYDECO. |
---|
9 |
% All Rights Reserved. |
---|
10 |
% Disclosure without written consent from the |
---|
11 |
% copyright owner does not constitute publication. |
---|
12 |
|
---|
13 |
if nargin > 0 |
---|
14 |
w = which(theFunction); |
---|
15 |
f = findstr(w, filesep); |
---|
16 |
if any(f) |
---|
17 |
w = w(1:f(length(f))); |
---|
18 |
eval(['cd(''' w(1:f(length(f))) ''')']) |
---|
19 |
end |
---|
20 |
end |
---|
21 |
disp([' ## ' pwd]) |
---|