cosangle1
returns the cosine of the
angle between a vector vecs and the subspace spanned
by the columns of the matrix mat. For cosangle, vecs can be a matrix, in
which case cosangle1 is called for each column in vecs.
cosangle(mat, vecs) cosangle1(mat, vec)
mat |
A matrix the provides the basis for a subspace |
vecs |
A vector with the same number of rows as mat, or a matrix with the same number of rows as mat |
vec |
A vector with the same number of rows as mat |
cosangle1
computes the cosine of the angle between vec and the orthogonal projection
of vec onto the column space of mat. cosangle
repeats this computation
for each column of vecs.
cosangle1 returns a single value and cosangle returns a vector.
Sanford Weisberg <sandy@stat.umn.edu>