Path: news.mathworks.com!not-for-mail
From: "Zeinab Al-Rekabi" <nospam-rekabi570@yahoo.ca>
Newsgroups: comp.soft-sys.matlab
Subject: Logicals, winding number, -inpolgon
Date: Fri, 20 Mar 2009 14:11:01 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 9
Message-ID: <gq085l$bpd$1@fred.mathworks.com>
Reply-To: "Zeinab Al-Rekabi" <nospam-rekabi570@yahoo.ca>
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 1237558261 12077 172.30.248.35 (20 Mar 2009 14:11:01 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Fri, 20 Mar 2009 14:11:01 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1426744
Xref: news.mathworks.com comp.soft-sys.matlab:526434

Hello

I am trying to compute the winding number, which is the number of times that a closed curve encircles the point.
I used the matlab function [IN]=inpolygon(X,Y,xv,yv), where X,Y are the points and xv,yv are the curves coutour (assuming 2d).

I obtain a logical array nX1, which has 0s and 1s. 0s being outside the countour and 1s being inside the contour. My question: how do I convert such a logical array into the X,Y numbers which it originally was, so baiscally for those values that were 1, how do I get their X,Y values? Is there a matlab function that does this conversion and if not may anyone assist me in obtaining them.

Thank you kindly
Z