Path: news.mathworks.com!newsfeed-00.mathworks.com!newscon02.news.prodigy.net!prodigy.net!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!cyclone1.gnilink.net!spamkiller2.gnilink.net!gnilink.net!trndny09.POSTED!702e7bde!not-for-mail
From: James Tursa <aclassyguywithaknotac@hotmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Pass structure to MATLAB
Message-ID: <70jmi39c96s8iudh4r1ajrrto95r873uak@4ax.com>
References: <fgb6fp$8rt$1@fred.mathworks.com> <6p9li3t0t4mc554emmf7q74rd5iut85d5l@4ax.com> <fgef3h$qrv$1@fred.mathworks.com>
X-Newsreader: Forte Agent 3.3/32.846
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Lines: 36
Date: Fri, 02 Nov 2007 16:20:16 GMT
NNTP-Posting-Host: 71.112.91.29
X-Complaints-To: abuse@verizon.net
X-Trace: trndny09 1194020416 71.112.91.29 (Fri, 02 Nov 2007 12:20:16 EDT)
NNTP-Posting-Date: Fri, 02 Nov 2007 12:20:16 EDT
Bytes: 2374
X-Original-Bytes: 2331
Xref: news.mathworks.com comp.soft-sys.matlab:435824


On Fri, 2 Nov 2007 06:12:01 +0000 (UTC), "Faisal "
<faisal_mufti.nospam@yahoo.com> wrote:

>Hi James,
>Thanks for putting so much effort in for the reply. However,
>you seems to have made all the processing within the
>mexFunction. On the otherhand I want it to be used as
>wrapper function. I want to do the implementation in my C++
>function and have mexFunction return it.

Before I write any more code, I need to clearly understand what it is
you are after. I gave you C routines that put your structures into the
MATLAB workspace using any name you like (I used "f" and "u" but you
could change that). You can call these routines from anywhere in your
code to put any number of your variables into the MATLAB workspace.
Apparently this is not what you want, exactly, so I need some help in
understand what you want. Could you write a hypothetical MATLAB
command line and then describe what it is you expect to happen? For
example, if you named my original file structput.c, then it would be
used as follows:

>> mex structput.c
>> structput

and the result would be two structure variables, f and u, that are in
the MATLAB workspace.

Are you trying to pass arguments, like this?

>> [out1 out2] = structmex(in1, in2, in2)

Do you get what I am asking?  Please give me an example of a command
line as you would like it to work and describe what should happen when
you invoke it. Thanks.

James Tursa