Skip to content

Query regarding linking R with Matlab

1 message · Henrik Bengtsson

#
Hi.
Matlab$startServer()

but that R fails to connect to Matlab by:

  matlab <- Matlab(host="localhost", port=9998)
  if (!open(matlab))
    throw("Matlab server is not running: waited 30 seconds.")

Sorry for not being explicit enough; if no port is given,
Matlab$startServer() will setup up Matlab to listen to port 9999 (as
explained in the help), but then you try to communicate with it via
port 9998.  I realize that the example might be a bit confusing since
it is using port 9998 (for the purpose of illustrating the fact that
you can choose another port).

Either try the above with   Matlab$startServer(port=9998), *or*, maybe simpler:

  Matlab$startServer()
  matlab <- Matlab(host="localhost")
  if (!open(matlab))
    throw("Matlab server is not running: waited 30 seconds.")

Does this work for you?

Henrik
On 12/27/06, Bhanu Kalyan.K <kalyansikha at yahoo.com> wrote: