Path: news.mathworks.com!not-for-mail
From: "Faisal " <faisal_mufti.nospam@yahoo.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Pass structure to MATLAB
Date: Mon, 5 Nov 2007 00:03:11 +0000 (UTC)
Organization: Australian National University
Lines: 35
Message-ID: <fglmjv$mc0$1@fred.mathworks.com>
References: <fgb6fp$8rt$1@fred.mathworks.com> <6p9li3t0t4mc554emmf7q74rd5iut85d5l@4ax.com> <fgef3h$qrv$1@fred.mathworks.com> <70jmi39c96s8iudh4r1ajrrto95r873uak@4ax.com> <fggni2$4sk$1@fred.mathworks.com> <gr9oi31ibje2d1608d9b53kef8a5kr8hvk@4ax.com> <fghqqr$5br$1@fred.mathworks.com> <8mbpi3t46ho1q6svitnckpscnj8o7n85oi@4ax.com> <fgk30j$jau$1@fred.mathworks.com> <lptri39i3da708skv77eju752ah8gf47c9@4ax.com>
Reply-To: "Faisal " <faisal_mufti.nospam@yahoo.com>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1194220991 22912 172.30.248.37 (5 Nov 2007 00:03:11 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Mon, 5 Nov 2007 00:03:11 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1014052
Xref: news.mathworks.com comp.soft-sys.matlab:436014


Hi
> 1) Do you want to pass f.dist and f.ampl and u.dist and
>u.ampl?  i.e.,do you want to pass all of them? Or just one
>of the versions, either> the double or the short?

Only f.ampl and f.dist. 

> 2) Do you want to pass them in addition to the structures
>that are already passed, or in place of the structures that
>are already passed?

No only them, not the structure

>Note that once the structures are in the MATLAB workspace,
>you can get at the individual arrays easily. For example,
>using the current code I
> just supplied:
 
I know that I can access the structured variables, but my
code works better in a non structured way as I have to do
some manipulation like 'find' which does not work on cells
so I again have to put loops in Matlab which will slow down
my processing time.

> Finally, note that I have assumed that an unsigned short
>in C was a 16-bit quantity. This isn't strictly guaranteed
>in C. You are really only guaranteed that a short is at
>least 16 bits, but it could be longer. To be more robust
>one would check sizeof(short) and then use
> an mxUINT16_CLASS or an mxUINT32_CLASS accordingly.

Thanks, I will see to it.

Regards,
Faisal