Evaluate a compiled MATLAB® function using the Python® object
returned from the initialize()
function.
result1,...resultN = my_client.function_name(in_args, nargout=nargs, stdout=out_stream, stderr=err_stream)
my_client
— Name
of object returned from initialize()
function_name
—
Name of the function to invoke
in_args
— Comma-separated
list of input arguments
nargs
— Number of
expected results. The default value is 1
.
out_stream
— Python StringIO
object
receiving the console output. The default is to direct output to the
console.
err_stream
— Python StringIO
object
receiving the error output. The default is to direct output to the
console.
Each variable on the left side of the function call is populated with a single return value.
Note:
If you provide less than result1, result2 = myMagic.triple(5,nargout=3) leaves |
To invoke the MATLAB function result = mutate(m1,
m2, m3)
from the package mutations
, you
use this code:
import mutations import matlab myMutator = mutations.initialize() m1 = matlab.double(...) m2 = matlab.double(...) m3 = matlab.double(...) result = myMutator.mutate(m1,m2,m3)
To invoke the MATLAB function mutate(m1,m2,m3)
from
the package mutations
, you use this code:
import mutations import matlab myMutator = mutations.initialize() m1 = matlab.double(...) m2 = matlab.double(...) m3 = matlab.double(...) myMutator.mutate(m1,m2,m3,nargout=0)
To invoke the MATLAB function c1,c2 = copy(o1,o2)
from
the package copier
, use this code:
>>> import copier >>> import matlab >>> myCopier = copier.initialize() >>> c1,c2 = myCopier.copy("blue",10,nargout=2) >>> print(c1) "blue" >>> print(c2) 10
To invoke the MATLAB function copies = copy(o1,o2)
from
the package copier
, use this code:
>>> import copier >>> import matlab >>> myCopier = copier.initialize() >>> copies = myCopier.copy("blue",10,nargout=2) >>> print(copies) ["blue",10]