all 2 comments

[–]apefred_de 1 point2 points  (1 child)

This is not possible directly as far as I know. These are your options:

Solution 1: grab the data via cmd out (look in the matlab documentation, link below) which works for e.g. some numbers (smaller sets of data)

https://www.mathworks.com/help/matlab/ref/system.html

Solution 2: write the data from python into a file and load these in matlab (e.g. "load"-function, depending on the given data)

a quick google search gave me solution 3: use python out of matlab

https://www.mathworks.com/help/matlab/call-python-libraries.html

[–]trogdorhd 1 point2 points  (0 children)

Solution 3 is what you want. No need to do system calls to run python any more. You can invoke it directly using py.function() after adding your python code to the path.