Efficiently call MATLAB code from another coding language
Ältere Kommentare anzeigen
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.
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Introduction to Installation and Licensing finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!