Hi, I want to connect to Matlab from netbeans and read some image files and do image processing. It works fine in last month,i did all the testing for my final reaserch and it worked fine. This is my cording to connect with Matlab,
MatlabProxyFactoryOptions options = new MatlabProxyFactoryOptions.Builder().setUsePreviouslyControlledSession(true).build();
MatlabProxyFactory factory = new MatlabProxyFactory(options);
MatlabProxy proxy=factory.getProxy();
// call builtin function
String curr="";
for (int i = 0; i < r.fileread(path).length; i++) {
curr=r.fileread(path)[i]+"\\*.bmp";
String out=r.fileread(path)[i]+".txt";
String newfile=r.fileread(path)[i]+"_new.txt";
//execute the addapth path command in matlab
proxy.eval("addpath('D:\\finalwk')");
//execute user defined functions
proxy.feval("Untitled",r.fileread(path)[i],curr,out);
proxy.feval("uni",out,newfile);
}
Now it dose not run from MatlabProxy proxy=factory.getProxy(); statement it opens Matlab and and gives a huge error,
Reconnecting to this session of MATLAB will not be possible matlabcontrol.MatlabConnectionException: Could not register this session of MATLAB at matlabcontrol.MatlabBroadcaster.bindSession(MatlabBroadcaster.java:144) at matlabcontrol.MatlabBroadcaster.broadcast(MatlabBroadcaster.java:92) at matlabcontrol.MatlabConnector$EstablishConnectionRunnable.run(MatlabConnector.java:209) at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source) at java.util.concurrent.FutureTask.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) Caused by: java.rmi.ConnectException: Connection refused to host: localhost; nested exception is: java.net.ConnectException: Connection timed out: connect at sun.rmi.transport.tcp.TCPEndpoint.newSocket(Unknown Source)...
Can Some one give an idea as soon as possible. Thanks