📄 whoami.m
字号:
function whoami% Test function to illustrate the use of the java.net package.%% Mastering MATLAB 7 Java Example 1 % Use try and catch to avoid an exception.try me = java.net.InetAddress.getLocalHost;catch error('Unable to get local host address.');end% Find my hostname and IP addressmyname = me.getHostName;myip = me.getHostAddress;% and print the results.disp(sprintf('My host name is %s', char(myname)));disp(sprintf('My IP address is %s', char(myip)));
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -