mexjulia icon indicating copy to clipboard operation
mexjulia copied to clipboard

jl.mexn has multi-output, but jl.call does not

Open standarddeviant opened this issue 7 years ago • 1 comments

This is related to https://github.com/twadleigh/mexjulia/issues/48 because I can't figure out how to get multiple outputs from a julia function.

Again, with this as the example:

# nargoutTest.jl
function nargoutTest(a,b)
  @show a, b
  return "outp1", "outpTWO"
end

I can't figure out how to cleanly get both outputs. I tried

jl.include('nargoutTest.jl')
[a,b] = jl.mexn(2,'nargoutTest',3,2)

That crashes MATLAB 2016b, Win10, x86-64 consistently. Given that mexn isn't in the README.md, I think I might be misusing it...

But at the moment, jl.call has no options for multiple outputs. Is this functionality a technical limitation, or something straightforward that just needs to be implemented?

standarddeviant avatar Jul 22 '17 22:07 standarddeviant

I think I see a solution to this after looking at the code, but am learning how mexjulia passes data around and how varargout works.

standarddeviant avatar Jul 25 '17 05:07 standarddeviant