Hi, I have noticed that when using R.matlab that the connection can become quite slow though it remains open. I have to kill both my R session and Matlab to start over and establish a new connection (eg. close(matlab) - seems hung). Is there a way around this?
I have been doing the following to establish the connection : Matlab(host="localhost", port=9999, remote=FALSE) matlab<- Matlab() isOpen.Matlab(matlab) Also, the initial examples in the help file work fine, but I encounter an error when trying to evaluate the following expression: # Create a function (M-file) on the Matlab server setFunction(matlab, " \ function [win,aver]=dice(B) \ %Play the dice game B times \ gains=[-1,2,-3,4,-5,6]; \ plays=unidrnd(6,B,1); \ win=sum(gains(plays)); \ aver=win/B; \ "); > evaluate(matlab, "[w,a]=dice(1000);") Error in list("evaluate(matlab, "[w,a]=dice(1000);")" = <environment>, : [2008-03-17 17:56:04] Exception: MatlabException: Undefined function or method ' unidrnd' for input arguments of type 'double'. at throw(Exception(...)) at throw.default("MatlabException: ", lasterr) at throw("MatlabException: ", lasterr) at readResult.Matlab(this) at readResult(this) at evaluate.Matlab(matlab, "[w,a]=dice(1000);") at evaluate(matlab, "[w,a]=dice(1000);") Also, can one use this package to call objects generated in Matlab using various toolboxes? > sessionInfo() R version 2.6.2 (2008-02-08) i386-apple-darwin8.10.1 locale: C attached base packages: [1] stats graphics grDevices utils datasets methods base other attached packages: [1] R.utils_1.0.1 R.matlab_1.1.4 R.oo_1.4.2 R.methodsS3_1.0.1 loaded via a namespace (and not attached): [1] rcompgen_0.1-17 Thanks, C [[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org 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.