isunix - Determine if MATLAB is running on Linux or Mac platforms - MATLAB (original) (raw)
Main Content
Determine if MATLAB is running on Linux or Mac platforms
Syntax
Description
tf = isunix
returns logical 1
(true
) if the version of MATLAB® is for Linux® or Apple macOS platforms. Otherwise, it returns logical 0
(false
).
Examples
if ismac % Code to run on Mac platform elseif isunix % Code to run on Linux platform elseif ispc % Code to run on Windows platform else disp('Platform not supported') end
Extended Capabilities
Usage notes and limitations:
- The generated code returns
true
orfalse
based on the platform on which it is run.
Version History
Introduced before R2006a