Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: mexfunction
Replies: 2   Last Post: Apr 8, 2013 2:39 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
James Tursa

Posts: 2,094
Registered: 8/5/09
Re: mexfunction
Posted: Apr 8, 2013 2:39 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

"Elnaz " <ebsadeghian@gmail.com> wrote in message <kjsq1l$akk$1@newscl01ah.mathworks.com>...
>
> My function defined in C has two outputs but when I call it from MATLAB command line it only returns the first output.
> I am calling mexfunction gateway for my 3 input, 2 output function as:


(snip)

> How can I get it to return the both?

[x y] = mymexfunction(a,b,c)

However, to keep from getting a seg fault and crashing MATLAB, you really should have a test for nlhs==2 in your code before you write into plhs[1].

James Tursa



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.