How can I run Python by getting values from Matlab

Click For Summary

Discussion Overview

The discussion centers on methods for running Python scripts that utilize input data from Matlab. Participants explore various approaches to facilitate the integration of these two programming environments, focusing on data transfer techniques.

Discussion Character

  • Technical explanation, Experimental/applied

Main Points Raised

  • One participant mentions attempting to use pymatlab but encountering failures, seeking alternative methods.
  • Another suggests using CSV files or NetCDF files as formats for data export from Matlab to Python.
  • A different participant points out that Scipy includes a function for loading Matlab .mat files, providing a potential solution.
  • Another approach proposed is to have Matlab write out a text file that Python can then read.

Areas of Agreement / Disagreement

Participants present multiple competing views on how to transfer data from Matlab to Python, with no consensus on a single best method.

Contextual Notes

Limitations include potential issues with the compatibility of file formats and the specific requirements of the data being transferred, which are not fully addressed in the discussion.

Nikhil N
Messages
80
Reaction score
2
I have a python script for which the input data are coming from Matlab. I have tried to use pymatlab, but it is failing. Can anyone suggest any other method?
 
Physics news on Phys.org
Scipy has a function to load Matlab mat files.

https://docs.scipy.org/doc/scipy/reference/tutorial/io.html
 
  • Like
Likes   Reactions: jedishrfu
Have Matlab write out a text file and have Python read it in.
 

Similar threads

Replies
5
Views
3K
  • · Replies 5 ·
Replies
5
Views
3K
Replies
6
Views
4K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 5 ·
Replies
5
Views
4K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 17 ·
Replies
17
Views
5K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K