how to call .exe file (made from standalone Simulink model) in .m file?

浪尽此生 提交于 2020-02-06 11:25:19

问题


When I use

!mdlname -p file.mat 

in command window of Matlab I have no errors, but when I use the command in .m file I get error that says that mat file can not be located. I tried to put full path name for file.mat like this

!mdlname -p c:\path..\file.mat

but I still get error saying mat file can not be found (error reading parameter data from mat-file)

I tried using function system in m file and it works but I can't force function system to use file.mat like I can with -p.


回答1:


system(['"zbroj.exe" -p zbro.mat']);

here is the solution, i tried and i tried and finally made it. zbroj.exe is a rsim exe from simulink model, -p is a switch that forces zbroj.exe to take input parameters from zbro.mat file.



来源:https://stackoverflow.com/questions/29376963/how-to-call-exe-file-made-from-standalone-simulink-model-in-m-file

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!