?? getusername.m
字號:
function userName = getusername
%GETUSERNAME Get user name.
% USERNAME = GETUSERNAME returns the login name of the current MATLAB
% user. Function should work for both Linux and Windows.
%
% Markus Buehren
% Last modified: 20.04.2008
%
% See also GETHOSTNAME.
persistent userNamePersistent
if isempty(userNamePersistent)
if ispc
userName = getenv('username');
else
systemCall = 'whoami';
[status, userName] = system(systemCall); %#ok
if status ~= 0
error('System call ''%s'' failed with return code %d.', systemCall, status);
end
userName = userName(1:end-1);
end
% save string for next function call
userNamePersistent = userName;
else
% return string computed before
userName = userNamePersistent;
end
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -