Compute cosine similarity between vectors 'x' and 'y'


Updated 16 May 2017

View License


Cs = getCosineSimilarity(x,y)

Compute Cosine Similarity between vectors x and y.
x and y have to be of same length. The interpretation of
cosine similarity is analogous to that of a Pearson Correlation

Cite As

Ruggero G. Bettinardi (2023). getCosineSimilarity(x,y) (, MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2009a
Compatible with any release
Platform Compatibility
Windows macOS Linux
Tags Add Tags

Community Treasure Hunt

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

Start Hunting!
Version Published Release Notes