Why does "pyrun" and "pyrunfile" return Python "NoneType" when using multiple output variables in MATLAB R2023a?

When I call "pyrun" or "pyrunfile" in MATLAB R2023a with one output argument it works; however when I change it to have two output arguments it returns variables of type Python NoneType with no properties. How do I get it to return multiple outputs?
[out1 out2] = pyrunfile("test.py", ['ouput1' 'output2']);

 Accepted Answer

In order to specify multiple outputs in "pyrun" and "pyrunfile" you have to use a string array:
["output1" "output2"]
or a character cell array:
{'output1' , 'output2'}

More Answers (0)

Products

Release

R2023b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!