with_matlab: Run matlab code using R.matlab

View source: R/util.R

with_matlabR Documentation

Run matlab code using R.matlab

Description

Utility that starts a matlab server, initialises an R.matlab Matlab instance connected to the Matlab server and passes it to a single arity input function. Therefore code inside the input function has access to the Matlab instance. Once the function has completed execution or if a failure occurs, the Matlab instance is disconnected and the Matlab server shutdown.

Usage

with_matlab(fn, trials = 60, interval = 1, ...)

Arguments

fn

Single arity function that accepts an initialised/connected Matlab object as input.

trials

maximum number of times to poll server for results.

interval

interval at which to poll server to check for results.

...

passed as arguments to start_matlab

Value

results of the input fn function


keithschulze/supr documentation built on Nov. 26, 2022, 7:09 a.m.