setdef.m

来自「一些制作正交曲线网格的matlab源程序」· M 代码 · 共 22 行

M
22
字号
function setdef(theFunction)% setdef -- Switch to directory of a function.%  setdef(theFunction) switches to the directory%   that contains theFunction.%  setdef (no argument) displays pwd.% Copyright (C) 1996 Dr. Charles R. Denham, ZYDECO.%  All Rights Reserved.%   Disclosure without written consent from the%    copyright owner does not constitute publication.if nargin > 0   w = which(theFunction);   f = findstr(w, filesep);   if any(f)      w = w(1:f(length(f)));      eval(['cd(''' w(1:f(length(f))) ''')'])   endenddisp([' ## ' pwd])

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?