simCos
Cosine of the angles betweeen two set of vectors
Contents
Syntax
- cosine = simCos(mat1, mat2)
Description
cosine = simCos(mat1, mat2) returns the cosine of the angles between two set of vectors mat1 and mat2.
- mat1: Data matrix 1 with each column is an observation
- mat2: Data matrix 2 with each column is an observation
- cosine: The cosine of the angles between two set of vectors mat1 and mat2.
The element at row i and column j of the return matrix is the cosine of the angle between column i of mat1 and column j of mat2.
Example
mat1=rand(2, 3); mat2=rand(2, 4); cosine=simCos(mat1, mat2)
cosine =
0.5888 0.8646 0.9207 0.9959
0.5183 0.8191 0.8845 0.9847
0.9419 0.9974 0.9805 0.8737