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 20:17:02 +0000 (UTC)
Organization: Imperial College London
Lines: 11
Message-ID: <h2tm3t$dvm$1@fred.mathworks.com>
References: <1861877.79321.1246884234900.JavaMail.jakarta@nitrogen.mathforum.org> <28112995.79623.1246887287751.JavaMail.jakarta@nitrogen.mathforum.org> <h2tkl2$3jl$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-03-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1246911422 14326 172.30.248.38 (6 Jul 2009 20:17:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Mon, 6 Jul 2009 20:17:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1570235
Xref: news.mathworks.com comp.soft-sys.matlab:553212


Woah

It was that! Thanks so much.

I actually was using y being a matrix of integer values, since it is stored like that when reading an image (uint8)

What would be best to simply pass double(y) to the function or try to read them as integers?

In fact, I have modified the C code, and right now I use the y[index] values as indices for performing operations, rather than looping once and again for (m ...) and scanning all the data for (x...) for (y...)

Jose