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

Correct

90Size
Leading solution size is 44.
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
 
%%
assert(isequal(right_triangle_sides(240),{ [15 112 113] [40 96 104] [48 90 102] [60 80 100] }))
x =
    60    80   100
x =
    60    80   100
    60    80   100
x =
    60    80   100
    60    80   100
    48    90   102
x =
    60    80   100
    60    80   100
    48    90   102
    48    90   102
x =
    60    80   100
    60    80   100
    48    90   102
    48    90   102
    40    96   104
x =
    60    80   100
    60    80   100
    48    90   102
    48    90   102
    40    96   104
    40    96   104
x =
    60    80   100
    60    80   100
    48    90   102
    48    90   102
    40    96   104
    40    96   104
    15   112   113
x =
    60    80   100
    60    80   100
    48    90   102
    48    90   102
    40    96   104
    40    96   104
    15   112   113
    15   112   113
2
Pass
 
%%
assert(isequal(right_triangle_sides(240),{ [15 112 113] [40 96 104] [48 90 102] [60 80 100] }))
x =
    60    80   100
x =
    60    80   100
    60    80   100
x =
    60    80   100
    60    80   100
    48    90   102
x =
    60    80   100
    60    80   100
    48    90   102
    48    90   102
x =
    60    80   100
    60    80   100
    48    90   102
    48    90   102
    40    96   104
x =
    60    80   100
    60    80   100
    48    90   102
    48    90   102
    40    96   104
    40    96   104
x =
    60    80   100
    60    80   100
    48    90   102
    48    90   102
    40    96   104
    40    96   104
    15   112   113
x =
    60    80   100
    60    80   100
    48    90   102
    48    90   102
    40    96   104
    40    96   104
    15   112   113
    15   112   113
3
Pass
 
%%
assert(isequal(right_triangle_sides(418),{ [57 176 185] }))
x =
    57   176   185
x =
    57   176   185
    57   176   185
4
Pass
 
%%
assert(isequal(right_triangle_sides(490),{ [140 147 203] }))
x =
   140   147   203
x =
   140   147   203
   140   147   203
5
Pass
 
%%
assert(isequal(right_triangle_sides(112),{ [14 48 50] }))
x =
    14    48    50
x =
    14    48    50
    14    48    50
6
Pass
 
%%
assert(isequal(right_triangle_sides(390),{ [52 165 173] [65 156 169] }))
x =
    65   156   169
x =
    65   156   169
    65   156   169
x =
    65   156   169
    65   156   169
    52   165   173
x =
    65   156   169
    65   156   169
    52   165   173
    52   165   173
7
Pass
 
%%
assert(isequal(right_triangle_sides(132),{ [11 60 61] [33 44 55] }))
x =
    33    44    55
x =
    33    44    55
    33    44    55
x =
    33    44    55
    33    44    55
    11    60    61
x =
    33    44    55
    33    44    55
    11    60    61
    11    60    61
8
Pass
 
%%
assert(isequal(right_triangle_sides(576),{ [64 252 260] [144 192 240] }))
x =
   144   192   240
x =
   144   192   240
   144   192   240
x =
   144   192   240
   144   192   240
    64   252   260
x =
   144   192   240
   144   192   240
    64   252   260
    64   252   260
9
Pass
 
%%
assert(isequal(right_triangle_sides(60),{ [10 24 26] [15 20 25] }))
x =
    15    20    25
x =
    15    20    25
    15    20    25
x =
    15    20    25
    15    20    25
    10    24    26
x =
    15    20    25
    15    20    25
    10    24    26
    10    24    26
10
Pass
 
%%
assert(isequal(right_triangle_sides(650),{ [25 312 313] }))
x =
    25   312   313
x =
    25   312   313
    25   312   313
11
Pass
 
%%
assert(isequal(right_triangle_sides(732),{ [183 244 305] }))
x =
   183   244   305
x =
   183   244   305
   183   244   305
12
Pass
 
%%
assert(isequal(right_triangle_sides(648),{ [162 216 270] }))
x =
   162   216   270
x =
   162   216   270
   162   216   270
13
Pass
 
%%
assert(isequal(right_triangle_sides(930),{ [155 372 403] }))
x =
   155   372   403
x =
   155   372   403
   155   372   403
14
Pass
 
%%
assert(isequal(right_triangle_sides(876),{ [219 292 365] }))
x =
   219   292   365
x =
   219   292   365
   219   292   365
15
Pass
 
%%
assert(isequal(right_triangle_sides(588),{ [84 245 259] [147 196 245] }))
x =
   147   196   245
x =
   147   196   245
   147   196   245
x =
   147   196   245
   147   196   245
    84   245   259
x =
   147   196   245
   147   196   245
    84   245   259
    84   245   259
16
Pass
 
%%
assert(isequal(right_triangle_sides(208),{ [39 80 89] }))
x =
    39    80    89
x =
    39    80    89
    39    80    89
17
Pass
 
%%
assert(isequal(right_triangle_sides(228),{ [57 76 95] }))
x =
    57    76    95
x =
    57    76    95
    57    76    95
18
Pass
 
%%
assert(isequal(right_triangle_sides(312),{ [24 143 145] [78 104 130] }))
x =
    78   104   130
x =
    78   104   130
    78   104   130
x =
    78   104   130
    78   104   130
    24   143   145
x =
    78   104   130
    78   104   130
    24   143   145
    24   143   145
19
Pass
 
%%
assert(isequal(right_triangle_sides(924),{ [42 440 442] [77 420 427] [132 385 407] [198 336 390] [231 308 385] }))
x =
   231   308   385
x =
   231   308   385
   231   308   385
x =
   231   308   385
   231   308   385
   198   336   390
x =
   231   308   385
   231   308   385
   198   336   390
   198   336   390
x =
   231   308   385
   231   308   385
   198   336   390
   198   336   390
   132   385   407
x =
   231   308   385
   231   308   385
   198   336   390
   198   336   390
   132   385   407
   132   385   407
x =
   231   308   385
   231   308   385
   198   336   390
   198   336   390
   132   385   407
   132   385   407
    77   420   427
x =
   231   308   385
   231   308   385
   198   336   390
   198   336   390
   132   385   407
   132   385   407
    77   420   427
    77   420   427
x =
   231   308   385
   231   308   385
   198   336   390
   198   336   390
   132   385   407
   132   385   407
    77   420   427
    77   420   427
    42   440   442
x =
   231   308   385
   231   308   385
   198   336   390
   198   336   390
   132   385   407
   132   385   407
    77   420   427
    77   420   427
    42   440   442
    42   440   442
20
Pass
 
%%
assert(isequal(right_triangle_sides(980),{ [280 294 406] }))
x =
   280   294   406
x =
   280   294   406
   280   294   406
21
Pass
 
%%
assert(isequal(right_triangle_sides(112),{ [14 48 50] }))
x =
    14    48    50
x =
    14    48    50
    14    48    50
22
Pass
 
%%
assert(isequal(right_triangle_sides(30),{ [5 12 13] }))
x =
     5    12    13
x =
     5    12    13
     5    12    13
23
Pass
 
%%
assert(isequal(right_triangle_sides(680),{ [102 280 298] [136 255 289] }))
x =
   136   255   289
x =
   136   255   289
   136   255   289
x =
   136   255   289
   136   255   289
   102   280   298
x =
   136   255   289
   136   255   289
   102   280   298
   102   280   298
24
Pass
 
%%
assert(isequal(right_triangle_sides(396),{ [33 180 183] [72 154 170] [99 132 165] }))
x =
    99   132   165
x =
    99   132   165
    99   132   165
x =
    99   132   165
    99   132   165
    72   154   170
x =
    99   132   165
    99   132   165
    72   154   170
    72   154   170
x =
    99   132   165
    99   132   165
    72   154   170
    72   154   170
    33   180   183
x =
    99   132   165
    99   132   165
    72   154   170
    72   154   170
    33   180   183
    33   180   183
25
Pass
 
%%
assert(isequal(right_triangle_sides(988),{ [266 312 410] }))
x =
   266   312   410
x =
   266   312   410
   266   312   410