Main Content

exclamation point, !

Operating system command

Syntax

Description

The exclamation point (!) issues operating system commands that you want to execute from within MATLAB®. For instance, !rmdir folder issues a command directly to the operating system to remove a folder.

This functionality is not available in MATLAB Online™.

example

Examples

expand all

The exclamation point (!) initiates a shell escape function. Such a function is performed directly by the operating system.

Use ! to instruct the operating system to remove a folder named example/folder.

!rmdir example/folder

Display the current directory.

!chdir

In addition to shell commands, you also can use ! to invoke external programs written in languages like C or Fortran.

Version History

Introduced before R2006a