Reading from dump or pickle file, and other files
56 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hi
i will start with my problem. i am working with a friend on a project. he gets dump files from a sensor and he extracts relevant data from the file to a pickle file.
i am working on an app with the matlab app designer that will get the data and do something with it.
our problem is in the interface between us. i admit i don't know what a dump file is and i didn't find how to work with matlab on those files, and when i looked for working with pickle files on matlab, all the answers talked about importing python libraries which is something i am trying to avoid.
so at this point he creates a pickle file which has a 3D matrix, and some other data... and we want to transfer that 3D matrix to my matlab app.
what i found so far is:
- as i mentioned, importing python libraries to matlab
- reshape the 3D matrix to 2D in python, then save it to a txt or excel file and then i read it with matlab and shape it back to 3D
So what i will please like to know is:
- is there a good and simple way to read pickle files in matlab?
- do you know any other file format that we could use to save that 3D matrix?
- if you know any other way to accomplish our goal it will be great!
thank you very much in advance
1 commentaire
Rik
le 17 Août 2020
The easiest way seems to be to avoid the pickle format in the first place. If you write your data as text, you can trivially read it with Matlab. Do you need to transfer exact floating point values or would a decimal representation be fine?
Réponses (1)
Juhi Singh
le 20 Août 2020
I understand that you want to have an interface between a pickle file and your MATLAB code. The easiest way to do that would be to convert the pickle file to 'mat' file.
You can do that in python with a few lines of code, as demonstrates in the link attached below:
I hope this answers your query.
0 commentaires
Voir également
Catégories
En savoir plus sur Call Python from MATLAB dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!