Skip to content

dos

miscellaneous · scripts/miscellaneous/dos.m

: status = dos (command)
: [status, result] = dos (command)
: [status, result] = dos (command, "-echo")

Execute command with the system shell and return status / stdout.

On every platform (including Linux and macOS) this forwards to system, matching MATLAB R2026a. With "-echo" the captured stdout is also printed via system’s "-echo" option. Any other second argument raises the same bang-parser style errors MATLAB reports.