Can I use the neural network trained by matlab to export and save python files like *. py for other programs?
Show older comments
Can I use the neural network trained by matlab to export and save python files like *. py for other programs?
6 Comments
Walter Roberson
on 6 Nov 2022
If i understand correctly, you have several python source code files, .py files, and you have examples of the same source code translated into other languages, and you wish to create a neural network that can accept python source code .py files and translate them to other languages automatically ???
slevin Lee
on 7 Nov 2022
Walter Roberson
on 7 Nov 2022
".py" is the file extension used for python source code. I would think it likely that those are UTF-8 encoded text files. It is for code, not for data storage.
Python can be used to read -v5 and -v5.3 and -v7 .mat files using
import scipy.io
mat = scipy.io.loadmat('file.mat')
This cannot handle -v7.3 files, but those are HDF5 files internally so Python HDF5 interfaces can be used.
Now, it is possible that the python code you wish to use expects the files to be in a particular format. If so we would need to know which format was expected.
For example MATLAB has exportONNXNetwork as one of the external file formats that are supported for export.
slevin Lee
on 7 Nov 2022
Walter Roberson
on 7 Nov 2022
You can call python functions inside MATLAB, and you can call MATLAB functions inside python.
slevin Lee
on 16 Nov 2022
Accepted Answer
More Answers (0)
Categories
Find more on Downloads in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!