computer

Information about computer on which MATLAB® software is running

Syntax

str = computer
[str,maxsize] = computer
[str,maxsize,endian] = computer
archstr = computer('arch')

Description

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

ispcisunixismac

GNU on x86

GLNX86

glnx86

010

Apple® Macintosh® OS X on x86

MACI

maci

011

Microsoft® Windows® on x86

PCWIN

win32

100

64–bit Platforms

Computer

str

archstr

ispcisunixismac

GNU Linux® on x86_64

GLNXA64

glnxa64

010

Microsoft Windows on x64

PCWIN64

win64

100

Sun™ Solaris™ on SPARC®

SOL64

sol64

010

Remarks

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.

See Also

getenv, setenv, ispc, isunix, ismac

  


 © 1984-2008- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS