matlab function in python's return is incomplete

I want to use matlab function in python, and the matlab function is difined like:
function [gam3,gam4]=calcgamma(N,FAV,NQ);
which the return is initialized as :
gam3=zeros(length(FAV),1);
gam4=zeros(length(FAV),NQ);
I omit this function's main calculation codes because I think it's unnecessary.
And running this function,the result should like that:
disp([gam3,gam4])
% below is the printed result
-12.6500 270.2543
0 1.5507
which means result should be :
gam3=[-12.6500, 0.0]
gam4=[270.2543, 1.5507]
In python, I use the MATLAB engine API for python, it already worked in other python tests. And the main codes like this:
f = [0.1, 0.5]
f = matlab.double(f)
n = 100
n = matlab.double([n])
result = eng.calcgamma(n,f,1)
print(result)
And it only prints this:
[ [-12.65996639124823], [0.0] ]
which means it only prints 'gam3' but omits 'gam4'.
I don't know the reason or solution. Please help me LOL.

Risposte (1)

Steven Lord
Steven Lord il 30 Set 2019
See the "Return Multiple Output Arguments from MATLAB Function" section on this documentation page.

Questa domanda è chiusa.

Richiesto:

il 30 Set 2019

Chiuso:

il 20 Ago 2021

Community Treasure Hunt

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

Start Hunting!

Translated by