Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: matlab typecast function very slow
Date: Tue, 3 Nov 2009 16:31:01 +0000 (UTC)
Organization: Boeing
Lines: 9
Message-ID: <hcpls5$a3q$1@fred.mathworks.com>
References: <05e24510-1633-4d87-9cbb-39230a6efeec@n35g2000yqm.googlegroups.com> <0598df9f-fdca-4bb3-bbb0-22b6ff33331c@a32g2000yqm.googlegroups.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-05-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1257265861 10362 172.30.248.35 (3 Nov 2009 16:31:01 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Tue, 3 Nov 2009 16:31:01 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 756104
Xref: news.mathworks.com comp.soft-sys.matlab:582084


roger <northsolomonsea@gmail.com> wrote in message <0598df9f-fdca-4bb3-bbb0-22b6ff33331c@a32g2000yqm.googlegroups.com>...
> 
> ... although I'll probably write the whole reading/converting
> part in C++ and transfer the lot back to matlab via mx the shared data
> copy is very interesting!

Tip if you go this route. First create your return variables with the mxCreate___ functions, then get the data pointers to them with the mxGetPr function. Then use *these* pointers in your reading. That way the data gets read directly into the mxArray variable that you want returned to MATLAB and you will avoid an extra data copy.

James Tursa