Problem accessing Simulink models from C#
Hi,
I want to access Simulink models from C#. I've added MATLAB Type Library reference in console App. But, When I call any function, it gives following error:
"An unhandled exception of type 'System.InvalidCastException' occurred in TestApp.exe
Additional information: QueryInterface for interface MLApp.DIMLApp failed."
Also find the piece of code:
MLApp.MLAppClass matlab = new MLApp.MLAppClass();
matlab.Execute("simulink");
Hoping for positive response.
Thanks and Regards,
Ajit Karve
|