I am trying to run my .m file from eclipse using matlabControl but i get an error in matlab console

2 views (last 30 days)
I have a .m file that on loading to matlab manually generates the Simulink model for the same. Now i am trying to achieve the same using eclipse from java. I have already configured MatlabControl with my eclipse.
My main function in java has the following code
MatlabProxyFactory factory = new MatlabProxyFactory(options);
MatlabProxy proxy = factory.getProxy();
proxy.eval("test_3.m"); // 'test_3.m' is the name of my .m file
On executing the java file from eclipse it opens Matlab and prints the following error on Matlab console
"Undefined variable "test_3" or class "test_3.m" "
How can I solve this so that my .m file runs and generates the Simulink model?
Any help would be appreciated!!

Accepted Answer

Walter Roberson
Walter Roberson on 6 Aug 2016
Experiment with
proxy.eval("run('test_3.m')")

More Answers (0)

Categories

Find more on Java Package Integration in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!