Mat File into Pyhton, dict value at 0x000....

4 vues (au cours des 30 derniers jours)
Nick Froidl
Nick Froidl le 11 Fév 2021
Modifié(e) : Pranav Verma le 16 Fév 2021
Hello guys!
i want to read .mat FIles into Python. My code looks like this:
import matlab.engine
eng = matlab.engine.start_matlab()
content = eng.load("Sink22.mat")
print("Class Matlab Meth:",type(content))
keys = content.keys()
print("Keys:", keys)
print("Key length:", len(keys))
values = content.values()
print("Values:",values)
print("Value length:", len(values))
When I print the "Values" i get the answer:
Values: dict_values([<matlab.object object at 0x000001761C55A3F0>])
Can someone explain me what this answer means?
Thanks a lot!

Réponses (1)

Pranav Verma
Pranav Verma le 16 Fév 2021
Modifié(e) : Pranav Verma le 16 Fév 2021
Hi Nick,
From your question, I understand that you are trying to print the "values" object. So before printing it out on the console, you can try checking the type of the variable "values" and then try using the appropriate typecasting or other string conversion methods to print out the desired value.
Alternatively, you can try checking if there are other packages available for importing mat files.
Thanks

Catégories

En savoir plus sur Call MATLAB from Python dans Help Center et File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by