euclidean distance calculation for values from excel sheet

2 ビュー (過去 30 日間)
krishnasri
krishnasri 2015 年 3 月 26 日
編集済み: dpb 2015 年 4 月 21 日
sir, I have values in an excel sheet, which contains 60x3 values, they are x,y,z cordinates for all the 60 points.Now I need to find out the distance : |d(i)|=sqrt((x(k)-x(j))^2+(y(k)-y(j))^2+(z(k)-z(j)^2)), where i=1:60 , j,k are end points of the line segment under consideration, i.e., between these 60 points line segments are considered, for which this distance we are calculating. So j,k can be j=1:59 and k=2:60..
Can you please help me with the code...
  22 件のコメント
krishnasri
krishnasri 2015 年 4 月 19 日
I didn't understand what you meant by which pdist2? I've matlab r2010a installed.
dpb
dpb 2015 年 4 月 19 日
編集済み: dpb 2015 年 4 月 21 日
Type it in at the command line...see
doc which
It'll show you which is the referenced pdist2 actually being called and in your above error the string "D:\pdist2.m" certainly makes it appear as if the problem is there is a script called PDIST2 which, if really so, is aliasing the TMW-supplied PDIST2 that you're trying to use.
The likely thing is that you named your top-level script pdist2 without realizing there is a builtin function of that name; if so rename that script to something else. Since Matlab is case-sensitive, use "PDIST2.m" or "pDist2.m" or some other name entirely, but anything but "pdist2.m".
PS:
"anything" above of course means "anything except pdis2.m or any other builtin function*.

サインインしてコメントする。

採用された回答

dpb
dpb 2015 年 3 月 26 日
If you have the Statistics Toolbox,
doc pdist

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeGaussian Process Regression についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by