Henrik,
         Here is the matlab response:

>> MatlabServer
Matlab v7.x or higher detected.
Saving with option -V6.
Added InputStreamByteWrapper to dynamic Java CLASSPATH.
----------------------
Matlab server started!
----------------------
Trying to open server socket (port 9999)...done.

so I connect to matlab using
open(matlab)
in R:

Connected to client.

then I send the variable to matlab:
setVariable(matlab, y=y,remote=FALSE)
Received cmd: 3
Will read MAT file:
"C:\Users\FAN'S~1\AppData\Local\Temp\Rtmpl04K6T\file2fff3c61.mat"
setVariable(matlab, x=x,remote=FALSE)
Received cmd: 3
Will read MAT file:
"C:\Users\FAN'S~1\AppData\Local\Temp\Rtmpl04K6T\file288f6c69.mat"
setVariable(matlab, z=z,remote=FALSE)
Received cmd: 3
Will read MAT file:
"C:\Users\FAN'S~1\AppData\Local\Temp\Rtmpl04K6T\file22cd3a61.mat"

evaluate(matlab,"B=TSLS(y,x,z);")
Received cmd: 1
"eval" string: "B=TSLS(y,x,z);"
Sent byte: 0
evaluate(matlab,"B")
Received cmd: 1
"eval" string: "B"
B =
   -0.7548
Sent byte: 0
B <- getVariable(matlab, "B",remote=FALSE)
Received cmd: 2
save
C:\Users\FAN'SH~1\AppData\Local\Temp\tp4f05d961_4460_47ba_a064_cfd418a19d60.mat
-V6 B
??? Error: A MATLAB string constant is not terminated properly.
Error in ==> MatlabServer at 197
      eval(expr);


Thanks,

Michael

	[[alternative HTML version deleted]]

