| MATLAB Function Reference | ![]() |
Information about computer on which MATLAB® software is running
str = computer
[str,maxsize] =
computer
[str,maxsize,endian] = computer
archstr = computer('arch')
str = computer returns the string str with the computer type on which MATLAB software is running.
[str,maxsize] = computer returns the integer maxsize, which contains the maximum number of elements allowed in an array with this version of MATLAB software.
[str,maxsize,endian] = computer also returns either 'L' for little-endian byte ordering or 'B' for big-endian byte ordering.
archstr = computer('arch') returns the string archstr which is the architecture of the build platform. This string can be used for the term arch in the mex command switch -<arch>.
The list of supported computers changes as new computers are added and others become obsolete. A typical list follows.
32–bit Platforms
Computer | str | archstr | ispc | isunix | ismac |
|---|---|---|---|---|---|
GNU on x86 | 0 | 1 | 0 | ||
Apple® Macintosh® OS X on x86 | MACI | maci | 0 | 1 | 1 |
Microsoft® Windows® on x86 | PCWIN | win32 | 1 | 0 | 0 |
64–bit Platforms
Computer | str | archstr | ispc | isunix | ismac |
|---|---|---|---|---|---|
GNU Linux® on x86_64 | GLNXA64 | glnxa64 | 0 | 1 | 0 |
Microsoft Windows on x64 | PCWIN64 | win64 | 1 | 0 | 0 |
Sun™ Solaris™ on SPARC® | SOL64 | sol64 | 0 | 1 | 0 |
In some cases, both 32-bit and 64-bit versions of MATLAB can run on the same platform. In this case, the value returned by computer reflects which of these is running. For example, if you run a 32-bit version of MATLAB on a Windows x64 platform, computer returns PCWIN, indicating that the 32-bit version is running.
getenv, setenv, ispc, isunix, ismac
![]() | complex | cond | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |