victorlei / smop

Small Matlab to Python compiler
MIT License
1.08k stars 410 forks source link

Matlab built-in functions? #158

Open sean85914 opened 4 years ago

sean85914 commented 4 years ago

I have converted a .m file with some build-in functions in Matlab, such as mkdir, dlmread, sub2ind and imwrite; however, after the conversion, I seen the same functions in converted Python scripts, which are not defined. Is it possible to convert the function to Python? Or the feature is not supported? Thanks in advance.

sean85914 commented 4 years ago

The matlab file is from here

praful-dodda commented 3 years ago

I'm very new to this library as well. But I think, you may have to add those particular functions in the file libsmop.py in your somp library. For example if you want to add 'mkdir' function for your generated python file, in the libsmop.py file make a user-defined function named 'mkdir' using the built-in functions os.mkdir() or os.makedirs(). But, the author can explain better