Path: news.mathworks.com!newsfeed-00.mathworks.com!kanaga.switch.ch!switch.ch!news-fra1.dfn.de!newsfeed.pionier.net.pl!news.dialog.net.pl!not-for-mail
From: "uC" <bla.bla@uc.uc>
Newsgroups: comp.soft-sys.matlab
Subject: Re: density matrix conversion - vectorization
Date: Fri, 1 Aug 2008 18:12:26 +0200
Organization: Dialog Net
Lines: 38
Message-ID: <g6vcmb$hqn$1@news.dialog.net.pl>
References: <g6v9mp$g0r$1@news.dialog.net.pl> <g6vbjk$rbn$1@canopus.cc.umanitoba.ca>
NNTP-Posting-Host: dynamic-78-8-130-252.ssp.dialog.net.pl
Mime-Version: 1.0
Content-Type: text/plain;
Content-Transfer-Encoding: 7bit
X-Trace: news.dialog.net.pl 1217607179 18263 78.8.130.252 (1 Aug 2008 16:12:59 GMT)
X-Complaints-To: abuse@dialog.net.pl
NNTP-Posting-Date: Fri, 1 Aug 2008 16:12:59 +0000 (UTC)
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5512
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5512
Xref: news.mathworks.com comp.soft-sys.matlab:483147



"Walter Roberson" <roberson@ibd.nrc-cnrc.gc.ca> wrote in message 
news:g6vbjk$rbn$1@canopus.cc.umanitoba.ca...
> 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.

sorry for that. ok, the entity is a human, ane the MxN matrix is population 
density (one matrix element represents 25x25 meters pixel). so, form MxN 
matrix I would like to generate "real" people with their locations being 
randomly distributed within each 25x25 pixel

>>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

thanks for this example, however I don't think that's what I am looking for

best wishes,
uC