Can I use the neural network trained by matlab to export and save python files like *. py for other programs?
Mostrar comentarios más antiguos
Can I use the neural network trained by matlab to export and save python files like *. py for other programs?
6 comentarios
Walter Roberson
el 6 de Nov. de 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
el 7 de Nov. de 2022
Walter Roberson
el 7 de Nov. de 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
el 7 de Nov. de 2022
Walter Roberson
el 7 de Nov. de 2022
You can call python functions inside MATLAB, and you can call MATLAB functions inside python.
slevin Lee
el 16 de Nov. de 2022
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Call Python from MATLAB en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!