Cody

# Problem 381. Angle between two vectors

Solution 1390360

Submitted on 22 Dec 2017
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

### Test Suite

Test Status Code Input and Output
1   Fail
u = [0.5 0.5 0];; v = [1 0 0]; angle_in_degrees = vector2angle(u,v) assert(strcmp(num2str(angle_in_degrees),'45'))

angle_in_degrees = 45.0000 90.0000 90.0000 angle_in_degrees = 45.0000 90.0000 90.0000

Assertion failed.

2   Fail
u = [0 0 1]; v = [1 0 0]; angle_in_degrees = vector2angle(u,v) assert(strcmp(num2str(angle_in_degrees),'90'))

angle_in_degrees = 90 90 90 angle_in_degrees = 90 90 90

Assertion failed.

3   Fail
u = [0 0.8 1]; v = [1 0.3 0]; angle_in_degrees = vector2angle(u,v) assert(strcmp(num2str(round(angle_in_degrees)),'80'))

angle_in_degrees = 90.0000 79.6591 90.0000 angle_in_degrees = 90.0000 79.6591 90.0000

Assertion failed.

### Community Treasure Hunt

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

Start Hunting!