<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
  <channel>
    <title>'Help with find euclid distance with set of data points' Thread RSS Feed</title>
    <link>http://www.programmersheaven.com/</link>
    <description>Contains the latest posts from the thread 'Help with find euclid distance with set of data points' posted on the 'Matlab' forum at Programmer's Heaven.</description>
    <language>en</language>
    <copyright>Copyright 2012 Programmers Heaven</copyright>
    <pubDate>Wed, 23 May 2012 13:34:14 -0700</pubDate>
    <lastBuildDate>Wed, 23 May 2012 13:34:14 -0700</lastBuildDate>
    <generator>Argotic Syndication Framework 2007.3.0.1, http://www.codeplex.com/Argotic</generator>
    <docs>http://www.rssboard.org/rss-specification</docs>
    <ttl>360</ttl>
    <image>
      <url>http://www.programmersheaven.com/images/ph.gif</url>
      <title>Programmers Heaven</title>
      <link>http://www.programmersheaven.com/</link>
      <width>88</width>
      <height>31</height>
    </image>
    <item>
      <title>Help with find euclid distance with set of data points</title>
      <link>http://www.programmersheaven.com/mb/ctocplusplustomatlab/389870/389870/help-with-find-euclid-distance-with-set-of-data-points/</link>
      <description>So I have to write a function that will find the euclidean distance between every pair of points, given a set of data points X.  Can anyone help me with this.  I am not very good with Matlab.&lt;br /&gt;
&lt;br /&gt;
function [DM] = distance_matrix (X)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Assume that data points in X are represented by the rows of that matrix (there is no class label or&lt;br /&gt;
target value in the last column). &lt;br /&gt;
&lt;br /&gt;
Note that you can build this function from code knn.m (attached here)  with&lt;br /&gt;
minor modifications. Example output you can use to test your code:&lt;br /&gt;
&lt;br /&gt;
X = [1 2 3 4; 5 6 7 8; 9 10 11 12];&lt;br /&gt;
distance_matrix(X)&lt;br /&gt;
&lt;br /&gt;
ans =  0 8 16&lt;br /&gt;
       8 0 8&lt;br /&gt;
      16 8 0&lt;br /&gt;
&lt;br&gt;&lt;br&gt;&lt;strong&gt;Attachment:&lt;/strong&gt; &lt;a href="http://www.programmersheaven.com/mb/DownloadAttachment.aspx?AttachmentID=610"&gt;knn.m&lt;/a&gt; (1701 bytes | downloaded 93 times)</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/ctocplusplustomatlab/389870/389870/help-with-find-euclid-distance-with-set-of-data-points/</guid>
      <pubDate>Sun, 26 Apr 2009 11:34:34 -0700</pubDate>
      <category>Matlab</category>
    </item>
    <item>
      <title>Re: Help with find euclid distance with set of data points</title>
      <link>http://www.programmersheaven.com/mb/ctocplusplustomatlab/389870/389874/re-help-with-find-euclid-distance-with-set-of-data-points/#389874</link>
      <description>Here is the code to find the distance matrix:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="sourcecode"&gt;y = pdist(X,'euclidean')
dist_mat=squareform(y)&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
If you have other questions please post in www.sosmatlab.com. I will not answer here in the future.&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/ctocplusplustomatlab/389870/389874/re-help-with-find-euclid-distance-with-set-of-data-points/#389874</guid>
      <pubDate>Sun, 26 Apr 2009 13:16:42 -0700</pubDate>
      <category>Matlab</category>
    </item>
  </channel>
</rss>
