Converting numpy arrays in python to .mat in matlab
Show older comments
I have a 2D numpy array in python and I want to image this array in matlab using 'imagesc()'. I was trying to convert the array to Pandas DataFrame and then to export it as .csv file so that I can load it in matlab. But I feel there is an easier way than this. Ultimately what I want is to convert my python array to matlab matrix.
Accepted Answer
More Answers (1)
abraham rodriguez
on 18 Sep 2021
3 votes
In latest R2021a, you can pass a python numpy ndarray to double() and it will convert to a native matlab matrix, even when calling in console the numpy array it will suggest at the bottom "Use double function to convert to a MATLAB array"
Categories
Find more on Call Python from MATLAB in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!