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
Solution Comments
Show comments
Loading...
Problem Recent Solvers8
Suggested Problems
-
20979 Solvers
-
Create a random logical vector of N elements of which M are true.
103 Solvers
-
Split bread like the Pharaohs - Egyptian fractions and greedy algorithm
92 Solvers
-
192 Solvers
-
There are 10 types of people in the world
1278 Solvers
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
The expected results for tests 2 and 4 seem to be incorrect.
I will be sure to check them and fix them if there are any problems
yep you are right I had a mistype in my code so it did not run on the whole matrix
thanks I have corrected them
Thanks for the quick fix!