I want to read the result of my Dymola simulation into python to plot some variables. After the simulation I have the data as Matlab .mat file Do i have the option to export the results into the SDF format?
My first try to read the data into python doesn't work really well.
Код: Выделить всё
import scipy.io
# Pfad zur MAT-Datei definieren
dateipfad = r'C:\Users\Benutzername\Desktop\Python Interface for Dymola_test\HeatPumpCycle_CO2_0.30.mat'
# MAT-Datei einlesen
mat_contents = scipy.io.loadmat(dateipfad)
# Namen und Werte aller Variablen in der MAT-Datei ausgeben
for variable_name in mat_contents.keys():
variable_value = mat_contents[variable_name]
print(f"Variable '{variable_name}':")
print(variable_value)
print()

Источник: https://stackoverflow.com/questions/781 ... nto-python