Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Solution 413778

Submitted on 5 Mar 2014 by Reza Ahmadzadeh

Correct

18Size
Leading solution size is 10.
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

Test Suite

Test
Code Input and Output
1
Pass
 
%%
A = 1;
x_correct = 2/sqrt(sqrt(3));
tolerance = 1e-12;
assert(abs( side_length(A) - x_correct ) < tolerance)

                    
2
Pass
 
%%
A = sqrt(3);
x_correct = 2;
tolerance = 1e-12;
assert(abs(side_length(A) - x_correct) < tolerance)

                    
3
Pass
 
%%
A = 2;
x_correct = 2*sqrt(2)/sqrt(sqrt(3));
tolerance = 1e-12;
assert(abs(side_length(A) - x_correct) < tolerance)