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

1 次查看(过去 30 天)
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!!

采纳的回答

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

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Java Package Integration 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by