Running multiple m-files by batch on Windows OS “without” closing previously run m-file

房东的猫 提交于 2019-12-02 10:34:21

Option 1:

You can save all the relevant variables to a mat file at the end of aatest1 and load them at the begining of aatest2.

Option 2:

You can run your python script in matlab (without terminating aatest1).
Use matlab's system command to run the python script in Matlab:

[status,cmdout] = system( 'C:\python27\python.exe python.py input.xlsx' );

I suggest to write the names of the variables and their values you want to pass from aatest1.m to aatest2.m into a file in a format like:

variable1=value
variable2=value

aatest1.m creates this file with the names of the variables and their values, and aatest2.m reads the values from the file and initializes with those values the appropriate variables.

The batch file can finally after execution of aatest2.m delete the temporary used file to pass values of variables from one MATLAB script to next MATLAB script if there is no MATLAB function to delete a file directly from within aatest2.m.

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