In the Python API, how can I redirect the output of an asynchronous function call of a function without return value?
Show older comments
I am using the Python API and I want to redirect the output of an asynchronously called function without return value. Is this maybe impossible?
My Python Script looks a little bit like this:
import matlab.engine as eng
import StringIO
out = StringIO.StringIO()
MAT = eng.start_matlab()
ret = MAT.func('arg', async=True, nargout=0, stdout=out)
while not ret.done() : pass
print out.getvalue()
MAT.quit()
When running this script, there is only a line feed / carriage return printed. The return value of
ret.result()
is "None".
Accepted Answer
More Answers (0)
Categories
Find more on Call MATLAB from Python in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!