Cody

Problem 43215. Convert radians to degrees

Solution 3391338

Submitted on 26 Oct 2020
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
x = pi; y_correct = 180; assert(abs(RAD2DEG(x)-y_correct)<0.01)

Unrecognized function or variable 'X'. Error in RAD2DEG (line 2) rad2deg(X); Error in Test1 (line 3) assert(abs(RAD2DEG(x)-y_correct)<0.01)

2   Fail
x = -pi; y_correct = -180; assert(abs(RAD2DEG(x)-y_correct)<0.01)

Unrecognized function or variable 'X'. Error in RAD2DEG (line 2) rad2deg(X); Error in Test2 (line 3) assert(abs(RAD2DEG(x)-y_correct)<0.01)

3   Fail
x = pi/2; y_correct = 90; assert(abs(RAD2DEG(x)-y_correct)<0.01)

Unrecognized function or variable 'X'. Error in RAD2DEG (line 2) rad2deg(X); Error in Test3 (line 3) assert(abs(RAD2DEG(x)-y_correct)<0.01)

4   Fail
x = pi/4; y_correct = 45; assert(abs(RAD2DEG(x)-y_correct)<0.01)

Unrecognized function or variable 'X'. Error in RAD2DEG (line 2) rad2deg(X); Error in Test4 (line 3) assert(abs(RAD2DEG(x)-y_correct)<0.01)

Suggested Problems

More from this Author43

Community Treasure Hunt

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

Start Hunting!