Path: news.mathworks.com!newsfeed-00.mathworks.com!nlpi057.nbdc.sbc.com!prodigy.net!news.glorb.com!news.cse.ohio-state.edu!usenet01.sei.cmu.edu!elk.ncren.net!newsflash.concordia.ca!canopus.cc.umanitoba.ca!not-for-mail
From: roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson)
Newsgroups: comp.soft-sys.matlab
Subject: Re: density matrix conversion - vectorization
Date: Fri, 1 Aug 2008 15:54:28 +0000 (UTC)
Organization: National Research Council Canada - Conseil national de rechereches Canada
Lines: 25
Message-ID: <g6vbjk$rbn$1@canopus.cc.umanitoba.ca>
References: <g6v9mp$g0r$1@news.dialog.net.pl>
NNTP-Posting-Host: origin.ibd.nrc.ca
X-Trace: canopus.cc.umanitoba.ca 1217606068 28023 192.70.172.160 (1 Aug 2008 15:54:28 GMT)
X-Complaints-To: abuse@cc.umanitoba.ca
NNTP-Posting-Date: Fri, 1 Aug 2008 15:54:28 +0000 (UTC)
Originator: roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson)
Xref: news.mathworks.com comp.soft-sys.matlab:483135



In article <g6v9mp$g0r$1@news.dialog.net.pl>, uC <bla.bla@uc.uc> wrote:
>the problem is as follows:
>- there is a matrix MxN containing density values of some virtual 'entities'
>- the matrix needs to be processed and the result should contain the list of 
>coordinates of 'entities' coresponding to the location of the given density 
>point in MxN matrix (i.e. cooresponding to the coordinates of the density 
>point in MxN matrix).

Your talk of "entities" confuses me.

>I did it easily using three for loops (one for M, one for N and one for 
>density value) however it is quite slow since M and N ~=10k. does anyone has 
>any idea how to VECTORIZE it? I intentionally don't publish my code since I 
>am asking about the idea (if it is really needed for the discussion I can 
>post it).

Do you have the image processing toolbox? Have you tried

InEntity = TheMatrix > DensityCutoff;
B = bwboundaries(InEntity);     %or some other bwboundaries call

-- 
This is a Usenet signature block. Please do not quote it when replying
to one of my postings.
http://en.wikipedia.org/wiki/Signature_block