File Exchange

image thumbnail

Getusername

version 1.0 (1020 Bytes) by

Fetches the current user name.

0 Downloads

Updated

No License

PURPOSE:
This MATLAB mex function fetches the name of the current user. The function is only for windows operating system. It was tested for MATLAB release 12.1 running under windows 12.1

COMPILE AND LINK AS A MATLAB MEX DLL:

type
mex getusername.c

on MATLAB command prompt to compile and link the program as a MATLAB mex dll.

CALLING SYNTAX
The resulting file getusername.dll may be called just like a MATLAB m-file function with syntax:

[username] = getusername

without any input arguments.

Comments and Ratings (3)

I want to rate Martin Lechner's alternative as 5/5.

michael twardak

Under unix getenv('USER'); also works, string is casesensitive

Martin Lechner

Matlab 6.5 for windows operating system:
getenv('UserName') also works

MATLAB Release
MATLAB 6.1 (R12.1)
Acknowledgements

Inspired: getUserName

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video