System Commands - MATLAB & Simulink (original) (raw)
Main Content
Interact programmatically with operating system and MATLABĀ® environment
System commands provide programmatic access to your operating system and the MATLAB environment. Using these commands, you can access information about your computer, copy content to the system clipboard, get and set environment variables, and execute operating system commands. To access and modify options for tools within MATLAB, such as the Command Window, Editor, or App Designer, use settings. To store and access your own data across MATLAB sessions, create custom settings.
Functions
clipboard | Copy and paste text to and from system clipboard |
---|---|
computer | Information about computer on which MATLAB is running |
system | Execute operating system command and return output |
cmdsep | Command separator for current platform (Since R2023b) |
dos | Execute DOS command and return output |
unix | Execute UNIX command and return output |
getenv | Get environment variable |
loadenv | Load environment variables from .env and plain text files (Since R2023a) |
isenv | Determine if environment variable exists (Since R2022b) |
setenv | Set environment variable |
unsetenv | Remove environment variable (Since R2022b) |
perl | Call Perl script using operating system executable |
winqueryreg | Item from Windows registry |
Settings
Topics
- Access and Modify Settings Programmatically
Access and modify settings for tools such as fonts and colors programmatically. - Create Custom Settings
Create custom settings to store and access data programmatically across sessions. - Shell Escape Function Example
Call external programs by issuing operating system commands. - Run External Commands, Scripts, and Programs
Use the!
character to call an operating system command. Run UNIX programs off the system path. - Change Environment Variable for Shell Command
Substitute a user-specified value for an environment variable value set by MATLAB when you call a function using thesystem
command.