Distance from points to points.

It's possible to read these coordinates from a text file formatted in this way:

2 comentarios

Image Analyst
Image Analyst el 5 de Feb. de 2014
Isn't this a duplicate of http://www.mathworks.com/matlabcentral/answers/114838#answer_123302 which already has people responding?
Francesco
Francesco el 5 de Feb. de 2014
It's not exactly the same questions.

Iniciar sesión para comentar.

 Respuesta aceptada

Walter Roberson
Walter Roberson el 5 de Feb. de 2014

0 votos

The identifier would be the row index of D.

4 comentarios

Francesco
Francesco el 5 de Feb. de 2014
[X, Y] = ndgrid(1:N);
identifiers = arrayfun(@(X,Y) sprintf('%d_%d', X, Y), X, Y, 'Uniform', 0);
When you before said this, what do you mean with N? What's the index of D?
Walter Roberson
Walter Roberson el 5 de Feb. de 2014
You had N points.
D refers to the output of pdist.
Francesco
Francesco el 5 de Feb. de 2014
Thanks. In general If I have n points I have to do this, where rows is the numbers of rows of the txt file.
[X, Y] = ndgrid(1:rows);
identifiers = arrayfun(@(X,Y) sprintf('%d_%d', X, Y), X, Y, 'Uniform', 0);
How Can I use pdist? What can I enter as input?
Walter Roberson
Walter Roberson el 5 de Feb. de 2014
Your previous question asked about using identifiers of that form and defined what the identifiers should look like. This question asks about using linear identifiers of the form 1, 2, 3, ... 6 .... n*(n-1)/2. But you have not given any indication of how the two are to fit together.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Matrices and Arrays en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 5 de Feb. de 2014

Editada:

el 22 de Mzo. de 2014

Community Treasure Hunt

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

Start Hunting!

Translated by