Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

startServer.Matlab

Static method which starts a MATLAB server


Description

Static method which starts a MATLAB server on the local machine. Note that MATLAB v6 or later is required, since the MATLAB server relies on Java.

Usage

## Static method (use this):
## Matlab$startServer(matlab=getOption("matlab"), port=9999, minimize=TRUE,
##   options=c("nodesktop", "nodisplay", "nosplash"), workdir=".", ...)

## Don't use the below:
## S3 method for class 'Matlab'
startServer(this, matlab=getOption("matlab"), port=9999, minimize=TRUE,
  options=c("nodesktop", "nodisplay", "nosplash"), workdir=".", ...)

Arguments

matlab

An optional character string specifying the name of the matlab command, if different from "matlab". An absolute path are possible.

port

An optional integer in [1023, 65535]. If given, the environment variable MATLABSERVER_PORT is set specifying which port the MATLAB server should listen to for clients trying to connect. The default port is 9999.

minimize

When starting MATLAB on Windows, it is always opened in a new window (see 1. The MATLAB server running in MATLAB). If this argument is TRUE, the new window is minimized, otherwise not. This argument is ignored on non-Windows systems.

options

A character vector of options used to call the MATLAB application.

workdir

The working directory to be used by MATLAB.

...

Not used.

Details

This method is currently supported on Windows and Unix systems. Other systems are untested, but might work anyway.

Note that this method will return immediately upon calling system() internally, i.e. you will not receive a return value telling wether MATLAB was successfully started or not.

To specify the full path to the matlab software set the matlab option, e.g. options(matlab = "/opt/bin/matlab6.1"). If no such option exists, the value "matlab" will be used.

The MATLAB server relies on two files: 1) MatlabServer.m and 2) InputStreamByteWrapper.class These files exists in the externals/ and java/ directories of this package. However, if they do not exist in the current directory, which is the directory where MATLAB is started, copies of them will automatically be made.

Value

Returns nothing.

Author(s)

Henrik Bengtsson

See Also

For more information see Matlab.


R.matlab

Read and Write MAT Files and Call MATLAB from Within R

v3.6.2
LGPL (>= 2.1)
Authors
Henrik Bengtsson [aut, cre, cph], Andy Jacobson [ctb] (Internal MAT v4 reader), Jason Riedy [ctb] (Support for reading compressed files, sparse matrices and UTF-encoded strings.)
Initial release
2018-09-26

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.