uisetdir.m

来自「一个研究声多普勒计程仪很好的工具箱」· M 代码 · 共 29 行

M
29
字号
function theStatus = uisetdir(thePrompt, theInstruction)

% uisetdir -- Open the destination folder via dialog.
%  uisetdir('thePrompt', 'theInstruction') presents the "uiputfile"
%   dialog with 'thePrompt' and 'theInstruction', for selecting the
%   desired destination folder.  The returned status is logical(1)
%   if successful; otherwise, logical(0).
 
% Copyright (C) 1997 Dr. Charles R. Denham, ZYDECO.
%  All Rights Reserved.
%   Disclosure without explicit written consent from the
%    copyright owner does not constitute publication.
 
% Version of 03-Jul-1997 09:16:00.

if nargin < 1, thePrompt = 'Open The Destination Folder'; end
if nargin < 2, theInstruction = 'Save If Okay'; end

theFile = 0; thePath = 0;
[theFile, thePath] = uiputfile(theInstruction, thePrompt);

status = 0;                
if isstr(thePath) & any(thePath)
   status = 1;
   eval('cd(thePath)', 'status = 0;')
end

if nargout > 0, theStatus = any(any(status)); end

⌨️ 快捷键说明

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