Efficiently call MATLAB code from another coding language
이전 댓글 표시
Hi all,
I am trying to run a MATLAB code as a simulation within an optimisation framework to solve for the responses. The optimisaiton is performed using Intel Fortran in Visual Studio.
I am currently doing this via calling a batch (.bat) file that opens and runs a MATLAB .m file with a specified path:
matlab -noFigureWindows -nosplash -nodesktop -r "try, run('C:\Users\path\file.m'), catch, exit, end, exit"
However, this is opens and closes MATLAB for every simulation performed, which is quite inefficient.
I wondered if there is a better way?
I have had ideas of using MATLAB compiler to build a .exe application, or potentially directly calling MATLAB from Visual Studio Fortran code as if it were a subroutine, but am unsure if this is possible. I'd very much appriciate any advice/info on what is most efficient and how to achieve this.
Thank you
Edit -
I am currently using the MATLAB PDE toolbox in my code.
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Introduction to Installation and Licensing에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!