I've installed SMOP via pip and it seemed to work fine. I have smop-script.py
and smop.exe
files in my python folder \scripts\
folder.
Let's say I have a matlab file called myMatlabFile.m
located in C:\Users\MyMatlabCode
. How do I use smop to translate that file?
The SMOP documentation only includes an example of opening a file contained in a \smop\
folder with a main.py
and I don't have anything like that. Also, the github page doesn't say whether it works only with 2.7 or 3. or whatever.
I was hoping that this package would speed up my Matlab -> Python 3.6 conversion, but if there are better translators out there now please let me know that too/instead.
To convert Matlab to python, a tool named SMOP (Small Matlab and Octave to Python Compiler) is used. This tool is capable of understanding basic Matlab code and then parsing it to python. Although there are always limitations to every tool, this tool works best for small-level codes.
Summary. SMOP stands for Small Matlab/Octave to Python compiler. It is supposed to help those who attempt migration from Matlab to Python. Despite the similarities between the two languages, there are enough differences to make manual translation too time consuming.
MATLAB provides flexible, two-way integration with many programming languages, including Python. This allows different teams to work together and use MATLAB algorithms within production software and IT systems.
I just tried using to convert a matlab file with SMOP and it worked. I installed the software using pip in Anaconda Prompt environment.
pip install smop
After the installation I had the 0.41 Version.
I copied the file that I wanted to convert in the folder where I ran the pip code in the Anaconda Prompt environment.
Then I used the code smop and the file name .m and got a file .py in the same folder.
smop VI.m
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With