<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <!-- Created by GNU Texinfo 6.5, http://www.gnu.org/software/texinfo/ --> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>System Information (GNU Octave (version 5.1.0))</title> <meta name="description" content="System Information (GNU Octave (version 5.1.0))"> <meta name="keywords" content="System Information (GNU Octave (version 5.1.0))"> <meta name="resource-type" content="document"> <meta name="distribution" content="global"> <meta name="Generator" content="makeinfo"> <link href="index.html#Top" rel="start" title="Top"> <link href="Concept-Index.html#Concept-Index" rel="index" title="Concept Index"> <link href="index.html#SEC_Contents" rel="contents" title="Table of Contents"> <link href="System-Utilities.html#System-Utilities" rel="up" title="System Utilities"> <link href="Hashing-Functions.html#Hashing-Functions" rel="next" title="Hashing Functions"> <link href="Group-Database-Functions.html#Group-Database-Functions" rel="prev" title="Group Database Functions"> <style type="text/css"> <!-- a.summary-letter {text-decoration: none} blockquote.indentedblock {margin-right: 0em} blockquote.smallindentedblock {margin-right: 0em; font-size: smaller} blockquote.smallquotation {font-size: smaller} div.display {margin-left: 3.2em} div.example {margin-left: 3.2em} div.lisp {margin-left: 3.2em} div.smalldisplay {margin-left: 3.2em} div.smallexample {margin-left: 3.2em} div.smalllisp {margin-left: 3.2em} kbd {font-style: oblique} pre.display {font-family: inherit} pre.format {font-family: inherit} pre.menu-comment {font-family: serif} pre.menu-preformatted {font-family: serif} pre.smalldisplay {font-family: inherit; font-size: smaller} pre.smallexample {font-size: smaller} pre.smallformat {font-family: inherit; font-size: smaller} pre.smalllisp {font-size: smaller} span.nolinebreak {white-space: nowrap} span.roman {font-family: initial; font-weight: normal} span.sansserif {font-family: sans-serif; font-weight: normal} ul.no-bullet {list-style: none} --> </style> <link rel="stylesheet" type="text/css" href="octave.css"> </head> <body lang="en"> <a name="System-Information"></a> <div class="header"> <p> Next: <a href="Hashing-Functions.html#Hashing-Functions" accesskey="n" rel="next">Hashing Functions</a>, Previous: <a href="Group-Database-Functions.html#Group-Database-Functions" accesskey="p" rel="prev">Group Database Functions</a>, Up: <a href="System-Utilities.html#System-Utilities" accesskey="u" rel="up">System Utilities</a> [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Concept-Index.html#Concept-Index" title="Index" rel="index">Index</a>]</p> </div> <hr> <a name="System-Information-1"></a> <h3 class="section">36.11 System Information</h3> <a name="XREFcomputer"></a><dl> <dt><a name="index-computer"></a><em></em> <strong>computer</strong> <em>()</em></dt> <dt><a name="index-computer-1"></a><em><var>c</var> =</em> <strong>computer</strong> <em>()</em></dt> <dt><a name="index-computer-2"></a><em>[<var>c</var>, <var>maxsize</var>] =</em> <strong>computer</strong> <em>()</em></dt> <dt><a name="index-computer-3"></a><em>[<var>c</var>, <var>maxsize</var>, <var>endian</var>] =</em> <strong>computer</strong> <em>()</em></dt> <dt><a name="index-computer-4"></a><em><var>arch</var> =</em> <strong>computer</strong> <em>("arch")</em></dt> <dd><p>Print or return a string of the form <var>cpu</var>-<var>vendor</var>-<var>os</var> that identifies the type of computer that Octave is running on. </p> <p>If invoked with an output argument, the value is returned instead of printed. For example: </p> <div class="example"> <pre class="example">computer () -| x86_64-pc-linux-gnu mycomp = computer () ⇒ mycomp = x86_64-pc-linux-gnu </pre></div> <p>If two output arguments are requested, also return the maximum number of elements for an array. This will depend on whether Octave has been compiled with 32-bit or 64-bit index vectors. </p> <p>If three output arguments are requested, also return the byte order of the current system as a character (<code>"B"</code> for big-endian or <code>"L"</code> for little-endian). </p> <p>If the argument <code>"arch"</code> is specified, return a string indicating the architecture of the computer on which Octave is running. </p> <p><strong>See also:</strong> <a href="#XREFisunix">isunix</a>, <a href="#XREFismac">ismac</a>, <a href="#XREFispc">ispc</a>. </p></dd></dl> <a name="XREFuname"></a><dl> <dt><a name="index-uname"></a><em>[<var>uts</var>, <var>err</var>, <var>msg</var>] =</em> <strong>uname</strong> <em>()</em></dt> <dd><p>Return system information in the structure. </p> <p>For example: </p> <div class="example"> <pre class="example">uname () ⇒ { sysname = x86_64 nodename = segfault release = 2.6.15-1-amd64-k8-smp version = Linux machine = #2 SMP Thu Feb 23 04:57:49 UTC 2006 } </pre></div> <p>If successful, <var>err</var> is 0 and <var>msg</var> is an empty string. Otherwise, <var>err</var> is nonzero and <var>msg</var> contains a system-dependent error message. </p></dd></dl> <a name="XREFnproc"></a><dl> <dt><a name="index-nproc"></a><em></em> <strong>nproc</strong> <em>()</em></dt> <dt><a name="index-nproc-1"></a><em></em> <strong>nproc</strong> <em>(<var>query</var>)</em></dt> <dd><p>Return the current number of available processors. </p> <p>If called with the optional argument <var>query</var>, modify how processors are counted as follows: </p> <dl compact="compact"> <dt><code>all</code></dt> <dd><p>total number of processors. </p> </dd> <dt><code>current</code></dt> <dd><p>processors available to the current process. </p> </dd> <dt><code>overridable</code></dt> <dd><p>same as <code>current</code>, but overridable through the <code><span class="nolinebreak">OMP_NUM_THREADS</span></code><!-- /@w --> environment variable. </p></dd> </dl> </dd></dl> <a name="XREFispc"></a><dl> <dt><a name="index-ispc"></a><em></em> <strong>ispc</strong> <em>()</em></dt> <dd><p>Return true if Octave is running on a Windows system and false otherwise. </p> <p><strong>See also:</strong> <a href="#XREFisunix">isunix</a>, <a href="#XREFismac">ismac</a>. </p></dd></dl> <a name="XREFisunix"></a><dl> <dt><a name="index-isunix"></a><em></em> <strong>isunix</strong> <em>()</em></dt> <dd><p>Return true if Octave is running on a Unix-like system and false otherwise. </p> <p><strong>See also:</strong> <a href="#XREFismac">ismac</a>, <a href="#XREFispc">ispc</a>. </p></dd></dl> <a name="XREFismac"></a><dl> <dt><a name="index-ismac"></a><em></em> <strong>ismac</strong> <em>()</em></dt> <dd><p>Return true if Octave is running on a Mac OS X system and false otherwise. </p> <p><strong>See also:</strong> <a href="#XREFisunix">isunix</a>, <a href="#XREFispc">ispc</a>. </p></dd></dl> <a name="XREFisieee"></a><dl> <dt><a name="index-isieee"></a><em></em> <strong>isieee</strong> <em>()</em></dt> <dd><p>Return true if your computer <em>claims</em> to conform to the IEEE standard for floating point calculations. </p> <p>No actual tests are performed. </p></dd></dl> <a name="XREFisdeployed"></a><dl> <dt><a name="index-isdeployed"></a><em></em> <strong>isdeployed</strong> <em>()</em></dt> <dd><p>Return true if the current program has been compiled and is running separately from the Octave interpreter and false if it is running in the Octave interpreter. </p> <p>Currently, this function always returns false in Octave. </p></dd></dl> <a name="XREFisstudent"></a><dl> <dt><a name="index-isstudent"></a><em></em> <strong>isstudent</strong> <em>()</em></dt> <dd><p>Return true if running in the student edition of <small>MATLAB</small>. </p> <p><code>isstudent</code> always returns false in Octave. </p> <p><strong>See also:</strong> <a href="Logical-Values.html#XREFfalse">false</a>. </p></dd></dl> <a name="XREFOCTAVE_005fHOME"></a><dl> <dt><a name="index-OCTAVE_005fHOME"></a><em></em> <strong>OCTAVE_HOME</strong> <em>()</em></dt> <dd><p>Return the name of the top-level Octave installation directory. OCTAVE_HOME corresponds to the configuration variable <var>prefix</var>. </p> <p><strong>See also:</strong> <a href="Controlling-Subprocesses.html#XREFEXEC_005fPATH">EXEC_PATH</a>, <a href="Loading-and-Saving-Images.html#XREFIMAGE_005fPATH">IMAGE_PATH</a>, <a href="#XREFOCTAVE_005fEXEC_005fHOME">OCTAVE_EXEC_HOME</a>. </p></dd></dl> <a name="XREFOCTAVE_005fEXEC_005fHOME"></a><dl> <dt><a name="index-OCTAVE_005fEXEC_005fHOME"></a><em></em> <strong>OCTAVE_EXEC_HOME</strong> <em>()</em></dt> <dd><p>Return the name of the top-level Octave installation directory for architecture-dependent files. If not specified separately, the value is the same as OCTAVE_HOME. OCTAVE_EXEC_HOME corresponds to the configuration variable <var>exec_prefix</var>. </p> <p><strong>See also:</strong> <a href="Controlling-Subprocesses.html#XREFEXEC_005fPATH">EXEC_PATH</a>, <a href="Loading-and-Saving-Images.html#XREFIMAGE_005fPATH">IMAGE_PATH</a>, <a href="#XREFOCTAVE_005fHOME">OCTAVE_HOME</a>. </p></dd></dl> <a name="XREFmatlabroot"></a><dl> <dt><a name="index-matlabroot"></a><em></em> <strong>matlabroot</strong> <em>()</em></dt> <dd><p>Return the name of the top-level Octave installation directory. </p> <p>This is an alias for the function <code><span class="nolinebreak">OCTAVE_HOME</span></code><!-- /@w --> provided for compatibility. </p> <p><strong>See also:</strong> <a href="#XREFOCTAVE_005fHOME">OCTAVE_HOME</a>. </p></dd></dl> <a name="XREFOCTAVE_005fVERSION"></a><dl> <dt><a name="index-OCTAVE_005fVERSION"></a><em></em> <strong>OCTAVE_VERSION</strong> <em>()</em></dt> <dd><p>Return the version number of Octave as a string. </p> <p><strong>See also:</strong> <a href="#XREFver">ver</a>, <a href="#XREFversion">version</a>. </p></dd></dl> <a name="XREFversion"></a><dl> <dt><a name="index-version"></a><em><var>v</var> =</em> <strong>version</strong> <em>()</em></dt> <dt><a name="index-version-1"></a><em>[<var>v</var>, <var>d</var>] =</em> <strong>version</strong> <em>()</em></dt> <dt><a name="index-version-2"></a><em><var>v</var> =</em> <strong>version</strong> <em>(<var>feature</var>)</em></dt> <dd><p>Get version information for Octave. </p> <p>If called without input argument, the first return value <var>v</var> gives the version number of Octave as a string. The second return value <var>d</var> holds the release date as a string. </p> <p>The following options can be passed for <var>feature</var>: </p> <dl compact="compact"> <dt><code>"-date"</code></dt> <dd><p>for the release date of the running build, </p> </dd> <dt><code>"-description"</code></dt> <dd><p>for a description of the release (always an empty string), </p> </dd> <dt><code>"-release"</code></dt> <dd><p>for the name of the running build (always an empty string), </p> </dd> <dt><code>"-java"</code></dt> <dd><p>for version information of the Java VM, </p> </dd> <dt><code>"-fftw"</code></dt> <dd><p>for version information for the linked <small>FFTW</small>, </p> </dd> <dt><code>"-blas"</code></dt> <dd><p>for version information for the linked <small>BLAS</small>, </p> </dd> <dt><code>"-lapack"</code></dt> <dd><p>for version information for the linked <small>LAPACK</small>. </p> </dd> <dt><code>"-hgid"</code></dt> <dd><p>the mercurial ID of the sources used to build Octave. </p></dd> </dl> <p>The variant with no input and output argument is an alias for the function <code><span class="nolinebreak">OCTAVE_VERSION</span></code><!-- /@w --> provided for compatibility. </p> <p><strong>See also:</strong> <a href="#XREFOCTAVE_005fVERSION">OCTAVE_VERSION</a>, <a href="#XREFver">ver</a>. </p></dd></dl> <a name="XREFver"></a><dl> <dt><a name="index-ver"></a><em></em> <strong>ver</strong></dt> <dt><a name="index-ver-1"></a><em></em> <strong>ver</strong> <em>Octave</em></dt> <dt><a name="index-ver-2"></a><em></em> <strong>ver</strong> <em><var>package</var></em></dt> <dt><a name="index-ver-3"></a><em>v =</em> <strong>ver</strong> <em>(…)</em></dt> <dd> <p>Display a header containing the current Octave version number, license string, and operating system. The header is followed by a list of installed packages, versions, and installation directories. </p> <p>Use the package name <var>package</var> or Octave to limit the listing to a desired component. </p> <p>When called with an output argument, return a vector of structures describing Octave and each installed package. The structure includes the following fields. </p> <dl compact="compact"> <dt><code>Name</code></dt> <dd><p>Package name. </p> </dd> <dt><code>Version</code></dt> <dd><p>Version of the package. </p> </dd> <dt><code>Release</code></dt> <dd><p>Release of the package. </p> </dd> <dt><code>Date</code></dt> <dd><p>Date of the version/release. </p></dd> </dl> <p><strong>See also:</strong> <a href="#XREFversion">version</a>, <a href="Java-Interface-Functions.html#XREFusejava">usejava</a>, <a href="Installing-and-Removing-Packages.html#XREFpkg">pkg</a>. </p></dd></dl> <a name="XREFcompare_005fversions"></a><dl> <dt><a name="index-compare_005fversions"></a><em></em> <strong>compare_versions</strong> <em>(<var>v1</var>, <var>v2</var>, <var>operator</var>)</em></dt> <dd><p>Compare two version strings using the given <var>operator</var>. </p> <p>This function assumes that versions <var>v1</var> and <var>v2</var> are arbitrarily long strings made of numeric and period characters possibly followed by an arbitrary string (e.g., <code>"1.2.3"</code>, <code>"0.3"</code>, <code>"0.1.2+"</code>, or <code>"1.2.3.4-test1"</code>). </p> <p>The version is first split into numeric and character portions and then the parts are padded to be the same length (i.e., <code>"1.1"</code> would be padded to be <code>"1.1.0"</code> when being compared with <code>"1.1.1"</code>, and separately, the character parts of the strings are padded with nulls). </p> <p>The operator can be any logical operator from the set </p> <ul> <li> <code>"=="</code> equal </li><li> <code>"<"</code> less than </li><li> <code>"<="</code> less than or equal to </li><li> <code>">"</code> greater than </li><li> <code>">="</code> greater than or equal to </li><li> <code>"!="</code> not equal </li><li> <code>"~="</code> not equal </li></ul> <p>Note that version <code>"1.1-test2"</code> will compare as greater than <code>"1.1-test10"</code>. Also, since the numeric part is compared first, <code>"a"</code> compares less than <code>"1a"</code> because the second string starts with a numeric part even though <code>double ("a")</code> is greater than <code>double ("1").</code> </p></dd></dl> <a name="XREFlicense"></a><dl> <dt><a name="index-license"></a><em></em> <strong>license</strong></dt> <dt><a name="index-license-1"></a><em></em> <strong>license</strong> <em>inuse</em></dt> <dt><a name="index-license-2"></a><em></em> <strong>license</strong> <em>inuse <var>feature</var></em></dt> <dt><a name="index-license-3"></a><em></em> <strong>license</strong> <em>("inuse")</em></dt> <dt><a name="index-license-4"></a><em><var>retval</var> =</em> <strong>license</strong> <em>("inuse")</em></dt> <dt><a name="index-license-5"></a><em><var>retval</var> =</em> <strong>license</strong> <em>("test", <var>feature</var>)</em></dt> <dt><a name="index-license-6"></a><em><var>retval</var> =</em> <strong>license</strong> <em>("checkout", <var>feature</var>)</em></dt> <dt><a name="index-license-7"></a><em>[<var>retval</var>, <var>errmsg</var>] =</em> <strong>license</strong> <em>("checkout", <var>feature</var>)</em></dt> <dd><p>Get license information for Octave and Octave packages. </p> <p>GNU Octave is free software distributed under the GNU General Public License (GPL), and a license manager makes no sense. This function is provided only for <small>MATLAB</small> compatibility. </p> <p>When called with no extra input arguments, it returns the Octave license, otherwise the first input defines the operation mode and must be one of the following strings: <code>inuse</code>, <code>test</code>, and <code>checkout</code>. The optional <var>feature</var> argument can either be <code>"octave"</code> (core), or an Octave package. </p> <dl compact="compact"> <dt><code>"inuse"</code></dt> <dd><p>Returns a list of loaded features, i.e., octave and the list of loaded packages. If an output is requested, it returns a struct array with the fields <code>"feature"</code>, and <code>"user"</code>. </p> </dd> <dt><code>"test"</code></dt> <dd><p>Return true if the specified <var>feature</var> is installed, false otherwise. </p> <p>An optional third argument <code>"enable"</code> or <code>"disable"</code> is accepted but ignored. </p> </dd> <dt><code>"checkout"</code></dt> <dd><p>Return true if the specified <var>feature</var> is installed, false otherwise. An optional second output will have an error message if a package is not installed. </p> </dd> </dl> <p><strong>See also:</strong> <a href="Installing-and-Removing-Packages.html#XREFpkg">pkg</a>, <a href="#XREFver">ver</a>, <a href="#XREFversion">version</a>. </p></dd></dl> <a name="XREFgetrusage"></a><dl> <dt><a name="index-getrusage"></a><em></em> <strong>getrusage</strong> <em>()</em></dt> <dd><p>Return a structure containing a number of statistics about the current Octave process. </p> <p>Not all fields are available on all systems. If it is not possible to get CPU time statistics, the CPU time slots are set to zero. Other missing data are replaced by NaN. The list of possible fields is: </p> <dl compact="compact"> <dt><code>idrss</code></dt> <dd><p>Unshared data size. </p> </dd> <dt><code>inblock</code></dt> <dd><p>Number of block input operations. </p> </dd> <dt><code>isrss</code></dt> <dd><p>Unshared stack size. </p> </dd> <dt><code>ixrss</code></dt> <dd><p>Shared memory size. </p> </dd> <dt><code>majflt</code></dt> <dd><p>Number of major page faults. </p> </dd> <dt><code>maxrss</code></dt> <dd><p>Maximum data size. </p> </dd> <dt><code>minflt</code></dt> <dd><p>Number of minor page faults. </p> </dd> <dt><code>msgrcv</code></dt> <dd><p>Number of messages received. </p> </dd> <dt><code>msgsnd</code></dt> <dd><p>Number of messages sent. </p> </dd> <dt><code>nivcsw</code></dt> <dd><p>Number of involuntary context switches. </p> </dd> <dt><code>nsignals</code></dt> <dd><p>Number of signals received. </p> </dd> <dt><code>nswap</code></dt> <dd><p>Number of swaps. </p> </dd> <dt><code>nvcsw</code></dt> <dd><p>Number of voluntary context switches. </p> </dd> <dt><code>oublock</code></dt> <dd><p>Number of block output operations. </p> </dd> <dt><code>stime</code></dt> <dd><p>A structure containing the system CPU time used. The structure has the elements <code>sec</code> (seconds) <code>usec</code> (microseconds). </p> </dd> <dt><code>utime</code></dt> <dd><p>A structure containing the user CPU time used. The structure has the elements <code>sec</code> (seconds) <code>usec</code> (microseconds). </p></dd> </dl> </dd></dl> <a name="XREFwinqueryreg"></a><dl> <dt><a name="index-winqueryreg"></a><em><var>value</var> =</em> <strong>winqueryreg</strong> <em>(<var>rootkey</var>, <var>subkey</var>, <var>valuename</var>)</em></dt> <dt><a name="index-winqueryreg-1"></a><em><var>value</var> =</em> <strong>winqueryreg</strong> <em>(<var>rootkey</var>, <var>subkey</var>)</em></dt> <dt><a name="index-winqueryreg-2"></a><em><var>names</var> =</em> <strong>winqueryreg</strong> <em>(<code>"name"</code>, <var>rootkey</var>, <var>subkey</var>)</em></dt> <dd> <p>Query names or value from the Windows registry. </p> <p>On Windows, return the value of the registry key <var>subkey</var> from the root key <var>rootkey</var>. You can specify the name of the queried registry value with the optional argument <var>valuename</var>. Otherwise, if called with only two arguments or <var>valuename</var> is empty, then the default value of <var>subkey</var> is returned. If the registry value is of type <code>"REG_DWORD"</code> then <var>value</var> is of class int32. If the value is of the type <code>"REG_SZ"</code> or <code>"REG_EXPAND_SZ"</code> a string is returned. </p> <p>If the first argument is <code>"name"</code>, a cell array of strings with the names of the values at that key is returned. </p> <p>The variable <var>rootkey</var> must be a string with a valid root key identifier: </p> <dl compact="compact"> <dt>HKCR</dt> <dt>HKEY_CLASSES_ROOT</dt> <dt>HKEY_CURRENT_CONFIG</dt> <dt>HKCU</dt> <dt>HKEY_CURRENT_USER</dt> <dt>HKLM</dt> <dt>HKEY_LOCAL_MACHINE</dt> <dt>HKU</dt> <dt>HKEY_USERS</dt> <dt>HKEY_PERFORMANCE_DATA</dt> </dl> <p>Examples: </p> <p>Get a list of value names at the key <code>'HKCU\Environment'</code>: </p> <div class="example"> <pre class="example"><var>valuenames</var> = winqueryreg ("name", "HKEY_CURRENT_USER", ... "Environment"); </pre></div> <p>For each <var>valuenames</var>, display the value: </p> <div class="example"> <pre class="example">for <var>k</var> = 1:numel (<var>valuenames</var>) <var>val</var> = winqueryreg ("HKEY_CURRENT_USER", "Environment", ... <var>valuenames</var>{<var>k</var>}); <var>str</var> = sprintf ("%s = %s", <var>valuenames</var>{<var>k</var>}, num2str (<var>val</var>)); disp (<var>str</var>); endfor </pre></div> <p>On non-Windows platforms this function fails with an error. </p></dd></dl> <hr> <div class="header"> <p> Next: <a href="Hashing-Functions.html#Hashing-Functions" accesskey="n" rel="next">Hashing Functions</a>, Previous: <a href="Group-Database-Functions.html#Group-Database-Functions" accesskey="p" rel="prev">Group Database Functions</a>, Up: <a href="System-Utilities.html#System-Utilities" accesskey="u" rel="up">System Utilities</a> [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Concept-Index.html#Concept-Index" title="Index" rel="index">Index</a>]</p> </div> </body> </html>