[R] R.matlab question

Henrik Bengtsson hb at stat.berkeley.edu
Thu Dec 28 03:19:33 CET 2006


Hi,

a follow up after realizing that you might not have started the Matlab
application to listen on port 9998.  Try:

Matlab$startServer(port=9998)

and then

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

Does this help?

Henrik

On 12/20/06, Henrik Bengtsson <hb at stat.berkeley.edu> wrote:
> Hi.
>
> On 12/20/06, Aimin Yan <aiminy at iastate.edu> wrote:
> > Does anyone know how to solve this question about R.matlab?
> > I am in windowsXP, my matlab is matlab 7.0.0 19920(R14)
> >
> > thanks,
> >
> > Aimin
> >
> >  > matlab <- Matlab(host="localhost", port=9998)
> >  > if (!open(matlab)) throw("Matlab server is not running: waited 30 seconds.")
> > Error in list("throw("Matlab server is not running: waited 30 seconds.")" =
> > <environment>,  :
> >
> > [2006-12-17 22:26:03] Exception: Matlab server is not running: waited 30
> > seconds.
> >    at throw(Exception(...))
> >    at throw.default("Matlab server is not running: waited 30 seconds.")
> >    at throw("Matlab server is not running: waited 30 seconds.")
> > In addition: There were 30 warnings (use warnings() to see them)
> >  > warnings
> > function (...)
> > UseMethod("warnings")
> >  > warnings()
> > Warning messages:
> > 1: localhost:9998 cannot be opened
> > 2: localhost:9998 cannot be opened
> [snip]
> > 30: localhost:9998 cannot be opened
>
> This could be because your firewall is blocking R from connecting
> to Matlab.  Try a few different port numbers.  I recently learned that
> the current default port in R.matlab might not be the best one;
> different port intervals are reserved for different purposes, cf.
> http://www.iana.org/assignments/port-numbers.  That document indicates
> that a port number in [49152, 65535] might be better.  See if this
> helps.  Does someone else knowof a port interval that is more likely
> to work in general?
>
> You can also tell the Matlab object to report more details what it is
> trying to do by setting the verbosity threshold, i.e.
> setVerbose(matlab, threshold=-1); the lower the threshold the more
> details you'll see.
>
> Cheers
>
> Henrik
>
> >  >
> >
> > ______________________________________________
> > R-help at stat.math.ethz.ch mailing list
> > https://stat.ethz.ch/mailman/listinfo/r-help
> > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> > and provide commented, minimal, self-contained, reproducible code.
> >
>



More information about the R-help mailing list