MatlabPut: Access the Matlab workspace and its variables.

Description Usage Arguments Value Author(s) References See Also

Description

These functions allow the R user to assign or retrieve one or more Matlab variables from within R. One can assign R objects to the Matlab workspace and retrieve the values of existing Matlab variables as R objects.

Usage

1
2
.MatlabPut(..., engine, .values = list(...), where = "base")
.MatlabGet(what, engine, multi = FALSE, .convert = TRUE, where = "base")

Arguments

...

named R objects that are marshalled to Matlab and assigned in the Matlab workspace using the names given in the R call, e.g. .MatlabPut(x = 1, myStrings = c("a", "b"))

what

names of the Matlab variables whose values are to be retrieved.

.values

a named list of R objects to store as Matlab variables. This is provided as an equivalent to the ... but to be used for programmatic access to this function rather than interactive use.

engine

the Matlab engine reference used to identify the engine in which the variables are to be stored or retrieved.

where

currently ignored but may be used if we implement a MEX-based interface rather than an Engine-based interface, i.e. using the different Matlab external interfaces.

multi

a logical value indicating whether the results should be left in a list (TRUE), or if there is only one variable being requested to return that directly rather than as the only element in a list. FALSE is useful for interactive use, but multi = TRUE is the same regardless of the number of variables requested and useful in programmatic use.

.convert

a logical vector indicating which variables to convert to R objects and which to leave as references to Matlab objects. This is a vector parallel to the what vector of names so that the caller can specify which variables to convert and which to leave as references in a single call. This is recycled to have the same length as what.

Value

If multi is TRUE, a list with as many elements as variables requested. If multi is FALSE and the number of variables requested is 1, then just that object is returned.

Author(s)

Duncan Temple Lang <duncan@wald.ucdavis.edu>

References

Matlab External Interface Guide, the Engine API. Matlab User's Guide

See Also

.Matlab .MatlabEval .MatlabInit


omegahat/RMatlab documentation built on May 24, 2019, 1:54 p.m.