Test  Status  Code Input and Output 

1  Pass 
A = 12;
h = 4;
y_correct = [5 5 6];
assert(sum(abs(sidesOfTheTriangle(A,h)y_correct))<1e3)
b =
6
c =
25
x =
5
y =
5 5 6

2  Pass 
A = 60;
h = 5;
y_correct = [13 13 24];
assert(sum(abs(sidesOfTheTriangle(A,h)y_correct))<1e3)
b =
24
c =
169
x =
13
y =
13 13 24

3  Pass 
A = 120;
h = 8;
y_correct = [17 17 30];
assert(sum(abs(sidesOfTheTriangle(A,h)y_correct))<1e3)
b =
30
c =
289
x =
17
y =
17 17 30

4  Pass 
A = 50;
h = 11;
y_correct = [11.9021492607341 11.9021492607341 9.09090909090909];
assert(sum(abs(sidesOfTheTriangle(A,h)y_correct))<1e3)
b =
9.0909
c =
141.6612
x =
11.9021
y =
11.9021 11.9021 9.0909

5  Pass 
A = 5;
h = 3;
y_correct = [3.43187671366233 3.43187671366233 10/3];
assert(sum(abs(sidesOfTheTriangle(A,h)y_correct))<1e3)
b =
3.3333
c =
11.7778
x =
3.4319
y =
3.4319 3.4319 3.3333

6  Pass 
A = 150;
h = 10;
y_correct = [18.0277563773199 18.0277563773199 30];
assert(sum(abs(sidesOfTheTriangle(A,h)y_correct))<1e3)
b =
30
c =
325
x =
18.0278
y =
18.0278 18.0278 30.0000

7  Pass 
A = 5;
h = 0.5;
y_correct = [10.0124921972504 10.0124921972504 20];
assert(sum(abs(sidesOfTheTriangle(A,h)y_correct))<1e3)
b =
20
c =
100.2500
x =
10.0125
y =
10.0125 10.0125 20.0000

8  Pass 
A = 42;
h = pi;
y_correct = [13.7331777948941 13.7331777948941 26.7380304394384];
assert(sum(abs(sidesOfTheTriangle(A,h)y_correct))<1e3)
b =
26.7380
c =
188.6002
x =
13.7332
y =
13.7332 13.7332 26.7380

3241 Solvers
Getting the indices from a vector
2764 Solvers
314 Solvers
Element by element multiplication of two vectors
259 Solvers
Is this is a Tic Tac Toe X Win?
425 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!