username

by Daniel Shub, SG-Lib Toolbox: SolidGeometry 5.6 - Auxiliary function
, Creation date: 2018-11-17, Last change: 2025-08-18

returns user name and host name using JAVA

Description

..found in the internet..

See Also: , smbFilename , smbPSLibname

Example Illustration

 missing image of username

Syntax

[user,host]=username

Output Parameter

user: user name
host: host name

Examples


[u,h]=username

This software may be used free of charge for academic research and teaching purposes only. Commercial use, redistribution, modification, or reverse engineering is strictly prohibited. Access to source code is restricted and granted only under specific agreements. For licensing inquiries or commercial use, please contact: Tim C. Lueth

Algorithm (Workflow)

This function retrieves the current user's name and the host's name using Java methods in MATLAB. It also allows for optional date formatting based on input parameters.

Input Parameters

Output Results

Algorithm Steps

  1. Retrieve the user name using Java's System.getProperty('user.name').
  2. Retrieve the host name using Java's InetAddress.getLocalHost.getHostName.
  3. Call getfuncparams to obtain the datetag from varargin.
  4. Use a switch statement to handle different datetag values:
  5. If no output arguments are specified, print the host name using dbprintf.
Algorithm explaination created using ChatGPT on 2025-08-18 23:21. (Please note: No guarantee for the correctness of this explanation)

Last html export of this page out of FM database by TL: 2025-09-21