Loading symbolic variables from Matlab in Python
Asked Answered
R

0

6

I know spio.loadmat does not properly load symbolic variables created in Matlab into Python. But, I am wondering if anyone here has ever tried to load such .mat files in Python using any sort of trick.

Roselani answered 7/6, 2018 at 22:28 Comment(4)
Such a load would require recreating in sympy variables and expressions that mimic the MATLAB ones. Do you have any idea how similar they are? Maybe you need to give a MATLAB sample, and the sympy equivalent.Cervix
I personally have no idea how these modules interact with computer. But, it seems to me Matlab does a more rigorous definition for symbols far different from its numeric variables: doubles, chars, ... whereas in Python a symbol looks like a label attached to numeric variable. That's probably why defining a symbol in Matlab take more process time.Roselani
MATLAB syms is similar in purpose to sympy symbols().Cervix
The thing with scipy's savemat and loadmat is that they're designed for .mat files produced by old MATLAB versions (see note at the end of this doc page). Nowadays it's probably better to read .mat files using an HDF5 tool like h5py.Wardwarde

© 2022 - 2024 — McMap. All rights reserved.