How to get a computer id?

4 views (last 30 days)
Mr M.
Mr M. on 31 Jul 2015
Answered: Jan on 31 Jul 2015
In my output files I use to write notes like these: This data file is generated by myscript.m. The corresponding plot is generated by myscript_plot.m. Runing time is 2h30min.
But I would like to add something which indicates the computer and user: This script was run by thomas on the MacBook computer.
So it is possible to get info about the user and the computer?

Answers (2)

Image Analyst
Image Analyst on 31 Jul 2015
These functions are available:
Functions
ismac Determine if version is for Mac OS X platform
ispc Determine if version is for Windows (PC) platform
isstudent Determine if version is Student Version
isunix Determine if version is for Linux or Mac platforms
javachk Error message based on Java feature support
license Get license number or perform licensing task
usejava Determine if Java feature is available
ver Version information for MathWorks products
verLessThan Compare toolbox version to specified version string
version Version number for MATLAB and libraries
in addition to computer() and getenv(). On a windows system with geteenv() you can get the user who is logged in. Not sure what to do to get that info on an Mac.

Jan
Jan on 31 Jul 2015

Categories

Find more on Introduction to Installation and Licensing in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!