```Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Calculate distance between points
Date: Wed, 25 Jan 2012 20:45:10 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 22
Message-ID: <jfppkm\$ke1\$1@newscl01ah.mathworks.com>
NNTP-Posting-Host: www-00-blr.mathworks.com
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: newscl01ah.mathworks.com 1327524310 20929 172.30.248.45 (25 Jan 2012 20:45:10 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Wed, 25 Jan 2012 20:45:10 +0000 (UTC)
Xref: news.mathworks.com comp.soft-sys.matlab:755792

Hi I am very new in matlab. Can any body help me to figure it out?

Lets, I have a matrix (10 X 20), I want to calculate the distance of each point of the matrix from one certain point (another array of xy point). I want to check the distance of all points in the matrix with respect to xy point (first with respect to 1st xy coordinate then 2nd and to the end.) I want to use the loop system.

Example data:
(X1, Y1)  (x1, y1)
(X2, Y2)  (x2, y2)
(X3, Y3)  (x3, y3)
(..., ....)  (..., ....)
(..., ....)  (..., ....)
(..., ....)  (..., ....)
(Xn, Yn)  (xm, ym)

for I = 1, n
for I = 1, m
dist=sqrt((X(I)-x(I))^2+(Y(I)-Y(I))^2)
end
end

IS THIS THE CODE???

Thanks a lot.
```