Convert Matlab application into executable binary stand alone application. After that I have also explained how to integrate it into Python. Sample code screenshots attached
3. Pre Requisites
•Matlab Software with License
•MATLAB Compiler [License required]
•MATLAB Run Time Application [Free]
•Anaconda Navigator for Python [Free]
7. MATLAB Compiler
• MATLAB Compiler™ enables you to share MATLAB® programs as
standalone applications and web apps.
• With MATLAB Compiler you can also package and deploy MATLAB
programs and run as standalone or can be integrated with other applications
like Python.
• End users can run your applications royalty-free using MATLAB Runtime.
9. Create A sample Matlab Application
(This will create a text file and append the string passed to it)
function MySample(n)
%Create a text file in write mode
fid =fopen('MyFile.txt', 'w' );
%append the string variable received
fwrite(fid, n);
%Close the file
fclose(fid);
end
20. Python Code
import os
from datetime import datetime
import subprocess
x = "Current Time = "+datetime.now().strftime("%H:%M:%S")
subprocess.run([“MySample.exe", x])
f = open("MyFile.txt", "r")
print(f.read())