dist

From STX Wiki
< Programmer Guide‎ | Command Reference‎ | EVAL
Revision as of 17:31, 18 November 2010 by Admin (talk | contribs) (1 revision: Initial import)
Jump to navigationJump to search
dist

Calculate the distance matrix for all elements in the vector x or for all row vectors in the matrix x. I.e. d(i,j) = distance (x[i,*], x[j,*]). This is a subcommand of the EVAL command.

Usage:

dist(x)

Return Type:

matrix

Calculate the Euclidean distance from x to y. Both arguments must be either scalars or vectors.

Usage:

dist(x, y)

Return Type:

scalar

Calculate the Euclidean distances between all elements of xv or all row vectors of xm to the value ys or the vector yv. The result is a vector with x[!nrow] elements.

Usage:

dist(xv,ys)

dist(xm, yv)

Return Type:

vector

Navigation menu

Personal tools