Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Segmentation violation due to MEX code
Date: Mon, 6 Jul 2009 21:04:02 +0000 (UTC)
Organization: Imperial College London
Lines: 7
Message-ID: <h2tos2$fdt$1@fred.mathworks.com>
References: <h2tkfd$l84$1@fred.mathworks.com> <5b6d0b68-60e9-41be-a22f-ea755e2db20d@r33g2000yqn.googlegroups.com> <h2tmbf$t3o$1@fred.mathworks.com> <h2tn3p$kpc$1@fred.mathworks.com> <h2tnu1$dng$1@fred.mathworks.com> <h2togo$mdd$1@fred.mathworks.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 1246914242 15805 172.30.248.35 (6 Jul 2009 21:04:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Mon, 6 Jul 2009 21:04:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1570235
Xref: news.mathworks.com comp.soft-sys.matlab:553239


Jaja, sorry I misunderstood

The difference is not great though, but the solution you advised with accumarray takes around 1s in the best case (only that part of the code), while the MEX always takes 0.6s

I mean best for accumarray because it looks like it speeds up, as if Matlab had to warm up or something. The first time I call the routine it takes like 3s, and then fixes to around 1s. But the MEX code is always twice as fast.

Jose