Problem 43030. Find the diagonal of the square of side L

Solution 2991793

Submitted on 25 Sep 2020 by Benjamin
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   Pass
L = 1; D_correct = 1.414213562373095; assert( abs(square_diag(L)-D_correct) < 1e-09 )

2   Pass
L = 9; D_correct = 12.72792206135785; assert( abs(square_diag(L)-D_correct) < 1e-09 )

Suggested Problems

More from this Author14

Community Treasure Hunt

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

Start Hunting!