Problem 59721. finding vector pair with min angle between them
given a matrix with more than one row , compare row vectors of the given matrix and find the pair with the minumum angle between them , "without using the dot fucntion"
you can find the angle from the following formula
θ = cos-1 [ (a. b) / (|a| |b|) ]
the product between the two vectors is the dot product
a⋅b=∑(ai)*(bi) from i=1 to n
the length of a vector is the square root of the sum of the squares of the components
Solution Stats
Problem Comments
-
5 Comments
Show
2 older comments
dareen
on 28 Mar 2024
yep you are right I had a mistype in my code so it did not run on the whole matrix
dareen
on 28 Mar 2024
thanks I have corrected them
Christian Schröder
on 28 Mar 2024
Thanks for the quick fix!
Solution Comments
Show commentsProblem Recent Solvers7
Suggested Problems
-
Determine the number of odd integers in a vector
765 Solvers
-
98 Solvers
-
Find the index of the largest value in any vector X=[4,3,4,5,9,12,0,4.....5]
384 Solvers
-
7543 Solvers
-
Create the following sequence : 0 1 1 4 9 25 64 169 ...
197 Solvers
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!