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
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] }))
a =
  Columns 1 through 16
     1     2     3     4     5     6     7     8     9    10    11    12    13    14    15    16
  Columns 17 through 32
    17    18    19    20    21    22    23    24    25    26    27    28    29    30    31    32
  Columns 33 through 48
    33    34    35    36    37    38    39    40    41    42    43    44    45    46    47    48
  Columns 49 through 64
    49    50    51    52    53    54    55    56    57    58    59    60    61    62    63    64
  Columns 65 through 80
    65    66    67    68    69    70    71    72    73    74    75    76    77    78    79    80
  Columns 81 through 96
    81    82    83    84    85    86    87    88    89    90    91    92    93    94    95    96
  Columns 97 through 112
    97    98    99   100   101   102   103   104   105   106   107   108   109   110   111   112
  Columns 113 through 128
   113   114   115   116   117   118   119   120   121   122   123   124   125   126   127   128
  Columns 129 through 144
   129   130   131   132   133   134   135   136   137   138   139   140   141   142   143   144
  Columns 145 through 160
   145   146   147   148   149   150   151   152   153   154   155   156   157   158   159   160
  Columns 161 through 176
   161   162   163   164   165   166   167   168   169   170   171   172   173   174   175   176
  Columns 177 through 192
   177   178   179   180   181   182   183   184   185   186   187   188   189   190   191   192
  Columns 193 through 208
   193   194   195   196   197   198   199   200   201   202   203   204   205   206   207   208
  Columns 209 through 224
   209   210   211   212   213   214   215   216   217   218   219   220   221   222   223   224
  Columns 225 through 240
   225   226   227   228   229   230   231   232   233   234   235   236   237   238   239   240
b =
   1.0e+04 *
  Columns 1 through 10
    0.0119    0.0119    0.0118    0.0118    0.0117    0.0117    0.0116    0.0116    0.0115    0.0115
  Columns 11 through 20
    0.0114    0.0114    0.0113    0.0113    0.0112    0.0111    0.0111    0.0110    0.0110    0.0109
  Columns 21 through 30
    0.0108    0.0108    0.0107    0.0107    0.0106    0.0105    0.0105    0.0104    0.0104    0.0103
  Columns 31 through 40
    0.0102    0.0102    0.0101    0.0100    0.0100    0.0099    0.0098    0.0097    0.0097    0.0096
  Columns 41 through 50
    0.0095    0.0095    0.0094    0.0093    0.0092    0.0092    0.0091    0.0090    0.0089    0.0088
  Columns 51 through 60
    0.0088    0.0087    0.0086    0.0085    0.0084    0.0083    0.0083    0.0082    0.0081    0.0080
  Columns 61 through 70
    0.0079    0.0078    0.0077    0.0076    0.0075    0.0074    0.0074    0.0073    0.0072    0.0071
  Columns 71 through 80
    0.0070    0.0069    0.0068    0.0067    0.0065    0.0064    0.0063    0.0062    0.0061    0.0060
  Columns 81 through 90
    0.0059    0.0058    0.0057    0.0055    0.0054    0.0053    0.0052    0.0051    0.0049    0.0048
  Columns 91 through 100
    0.0047    0.0045    0.0044    0.0043    0.0041    0.0040    0.0039    0.0037    0.0036    0.0034
  Columns 101 through 110
    0.0033    0.0031    0.0030    0.0028    0.0027    0.0025    0.0023    0.0022    0.0020    0.0018
  Columns 111 through 120
    0.0017    0.0015    0.0013    0.0011    0.0010    0.0008    0.0006    0.0004    0.0002         0
  Columns 121 through 130
   -0.0002   -0.0004   -0.0006   -0.0008   -0.0010   -0.0013   -0.0015   -0.0017   -0.0019   -0.0022
  Columns 131 through 140
   -0.0024   -0.0027   -0.0029   -0.0032   -0.0034   -0.0037   -0.0040   -0.0042   -0.0045   -0.0048
  Columns 141 through 150
   -0.0051   -0.0054   -0.0057   -0.0060   -0.0063   -0.0066   -0.0070   -0.0073   -0.0076   -0.0080
  Columns 151 through 160
   -0.0084   -0.0087   -0.0091   -0.0095   -0.0099   -0.0103   -0.0107   -0.0111   -0.0116   -0.0120
  Columns 161 through 170
   -0.0125   -0.0129   -0.0134   -0.0139   -0.0144   -0.0149   -0.0155   -0.0160   -0.0166   -0.0171
  Columns 171 through 180
   -0.0177   -0.0184   -0.0190   -0.0196   -0.0203   -0.0210   -0.0217   -0.0225   -0.0232   -0.0240
  Columns 181 through 190
   -0.0248   -0.0257   -0.0265   -0.0274   -0.0284   -0.0293   -0.0303   -0.0314   -0.0325   -0.0336
  Columns 191 through 200
   -0.0348   -0.0360   -0.0373   -0.0386   -0.0400   -0.0415   -0.0430   -0.0446   -0.0462   -0.0480
  Columns 201 through 210
   -0.0498   -0.0518   -0.0538   -0.0560   -0.0583   -0.0607   -0.0633   -0.0660   -0.0689   -0.0720
  Columns 211 through 220
   -0.0753   -0.0789   -0.0827   -0.0868   -0.0912   -0.0960   -0.1012   -0.1069   -0.1131   -0.1200
  Columns 221 through 230
   -0.1276   -0.1360   -0.1454   -0.1560   -0.1680   -0.1817   -0.1975   -0.2160   -0.2378   -0.2640
  Columns 231 through 240
   -0.2960   -0.3360   -0.3874   -0.4560   -0.5520   -0.6960   -0.9360   -1.4160   -2.8560      -Inf
index =
  Columns 1 through 16
    15    40    48    60    80    90    96   112   120   140   144   150   160   165   168   176
  Columns 17 through 32
   180   190   192   195   200   204   208   210   215   216   220   222   224   225   228   230
  Columns 33 through 41
   231   232   234   235   236   237   238   239   240
b =
  Columns 1 through 8
         112          96          90          80          60          48          40          15
  Columns 9 through 16
           0         -48         -60         -80        -120        -144        -160        -210
  Columns 17 through 24
        -240        -336        -360        -400        -480        -560        -660        -720
  Columns 25 through 32
        -912        -960       -1200       -1360       -1560       -1680       -2160       -2640
  Columns 33 through 40
       -2960       -3360       -4560       -5520       -6960       -9360      -14160      -28560
  Column 41
        -Inf
c =
  Columns 1 through 8
         113         104         102         100         100         102         104         113
  Columns 9 through 16
         120         148         156         170         200         219         232         274
  Columns 17 through 24
         300         386         408         445         520         596         692         750
  Columns 25 through 32
         937         984        1220        1378        1576        1695        2172        2650
  Columns 33 through 40
        2969        3368        4566        5525        6964        9363       14162       28561
  Column 41
         Inf
mine =
  Columns 1 through 8
          15          40          48          60          80          90          96         112
         112          96          90          80          60          48          40          15
         113         104         102         100         100         102         104         113
  Columns 9 through 16
         120         140         144         150         160         165         168         176
           0         -48         -60         -80        -120        -144        -160        -210
         120         148         156         170         200         219         232         274
  Columns 17 through 24
         180         190         192         195         200         204         208         210
        -240        -336        -360        -400        -480        -560        -660        -720
         300         386         408         445         520         596         692         750
  Columns 25 through 32
         215         216         220         222         224         225         228         230
        -912        -960       -1200       -1360       -1560       -1680       -2160       -2640
         937         984        1220        1378        1576        1695        2172        2650
  Columns 33 through 40
         231         232         234         235         236         237         238         239
       -2960       -3360       -4560       -5520       -6960       -9360      -14160      -28560
        2969        3368        4566        5525        6964        9363       14162       28561
  Column 41
         240
        -Inf
         Inf
ans =
  Columns 1 through 8
          25           8          12           0         -12          -8         -25         -15
         -16          -6         -10           0          10           6          16           8
          -9          -2          -2           0           2           2           9           7
  Columns 9 through 16
         -48         -12         -20         -40         -24         -16         -50         -30
          20           4           6          10           5           3           8           4
          28           8          14          30          19          13          42          26
  Columns 17 through 24
         -96         -24         -40         -80         -80        -100         -60        -192
          10           2           3           5           4           4           2           5
          86          22          37          75          76          96          58         187
  Columns 25 through 32
         -48        -240        -160        -200        -120        -480        -480        -320
           1           4           2           2           1           3           2           1
          47         236         158         198         119         477         478         319
  Columns 33 through 40
        -400       -1200        -960       -1440       -2400       -4800      -14400        -Inf
           1           2           1           1           1           1           1           1
         399        1198         959        1439        2399        4799       14399         Inf
ans =
     4
mine =
    15    40    48    60
   112    96    90    80
   113   104   102   100
C =
    [1x3 double]
C =
    [1x3 double]    [1x3 double]
C =
    [1x3 double]    [1x3 double]    [1x3 double]
C =
    [1x3 double]    [1x3 double]    [1x3 double]    [1x3 double]
2
Pass
 
%%
assert(isequal(right_triangle_sides(240),{ [15 112 113] [40 96 104] [48 90 102] [60 80 100] }))
a =
  Columns 1 through 16
     1     2     3     4     5     6     7     8     9    10    11    12    13    14    15    16
  Columns 17 through 32
    17    18    19    20    21    22    23    24    25    26    27    28    29    30    31    32
  Columns 33 through 48
    33    34    35    36    37    38    39    40    41    42    43    44    45    46    47    48
  Columns 49 through 64
    49    50    51    52    53    54    55    56    57    58    59    60    61    62    63    64
  Columns 65 through 80
    65    66    67    68    69    70    71    72    73    74    75    76    77    78    79    80
  Columns 81 through 96
    81    82    83    84    85    86    87    88    89    90    91    92    93    94    95    96
  Columns 97 through 112
    97    98    99   100   101   102   103   104   105   106   107   108   109   110   111   112
  Columns 113 through 128
   113   114   115   116   117   118   119   120   121   122   123   124   125   126   127   128
  Columns 129 through 144
   129   130   131   132   133   134   135   136   137   138   139   140   141   142   143   144
  Columns 145 through 160
   145   146   147   148   149   150   151   152   153   154   155   156   157   158   159   160
  Columns 161 through 176
   161   162   163   164   165   166   167   168   169   170   171   172   173   174   175   176
  Columns 177 through 192
   177   178   179   180   181   182   183   184   185   186   187   188   189   190   191   192
  Columns 193 through 208
   193   194   195   196   197   198   199   200   201   202   203   204   205   206   207   208
  Columns 209 through 224
   209   210   211   212   213   214   215   216   217   218   219   220   221   222   223   224
  Columns 225 through 240
   225   226   227   228   229   230   231   232   233   234   235   236   237   238   239   240
b =
   1.0e+04 *
  Columns 1 through 10
    0.0119    0.0119    0.0118    0.0118    0.0117    0.0117    0.0116    0.0116    0.0115    0.0115
  Columns 11 through 20
    0.0114    0.0114    0.0113    0.0113    0.0112    0.0111    0.0111    0.0110    0.0110    0.0109
  Columns 21 through 30
    0.0108    0.0108    0.0107    0.0107    0.0106    0.0105    0.0105    0.0104    0.0104    0.0103
  Columns 31 through 40
    0.0102    0.0102    0.0101    0.0100    0.0100    0.0099    0.0098    0.0097    0.0097    0.0096
  Columns 41 through 50
    0.0095    0.0095    0.0094    0.0093    0.0092    0.0092    0.0091    0.0090    0.0089    0.0088
  Columns 51 through 60
    0.0088    0.0087    0.0086    0.0085    0.0084    0.0083    0.0083    0.0082    0.0081    0.0080
  Columns 61 through 70
    0.0079    0.0078    0.0077    0.0076    0.0075    0.0074    0.0074    0.0073    0.0072    0.0071
  Columns 71 through 80
    0.0070    0.0069    0.0068    0.0067    0.0065    0.0064    0.0063    0.0062    0.0061    0.0060
  Columns 81 through 90
    0.0059    0.0058    0.0057    0.0055    0.0054    0.0053    0.0052    0.0051    0.0049    0.0048
  Columns 91 through 100
    0.0047    0.0045    0.0044    0.0043    0.0041    0.0040    0.0039    0.0037    0.0036    0.0034
  Columns 101 through 110
    0.0033    0.0031    0.0030    0.0028    0.0027    0.0025    0.0023    0.0022    0.0020    0.0018
  Columns 111 through 120
    0.0017    0.0015    0.0013    0.0011    0.0010    0.0008    0.0006    0.0004    0.0002         0
  Columns 121 through 130
   -0.0002   -0.0004   -0.0006   -0.0008   -0.0010   -0.0013   -0.0015   -0.0017   -0.0019   -0.0022
  Columns 131 through 140
   -0.0024   -0.0027   -0.0029   -0.0032   -0.0034   -0.0037   -0.0040   -0.0042   -0.0045   -0.0048
  Columns 141 through 150
   -0.0051   -0.0054   -0.0057   -0.0060   -0.0063   -0.0066   -0.0070   -0.0073   -0.0076   -0.0080
  Columns 151 through 160
   -0.0084   -0.0087   -0.0091   -0.0095   -0.0099   -0.0103   -0.0107   -0.0111   -0.0116   -0.0120
  Columns 161 through 170
   -0.0125   -0.0129   -0.0134   -0.0139   -0.0144   -0.0149   -0.0155   -0.0160   -0.0166   -0.0171
  Columns 171 through 180
   -0.0177   -0.0184   -0.0190   -0.0196   -0.0203   -0.0210   -0.0217   -0.0225   -0.0232   -0.0240
  Columns 181 through 190
   -0.0248   -0.0257   -0.0265   -0.0274   -0.0284   -0.0293   -0.0303   -0.0314   -0.0325   -0.0336
  Columns 191 through 200
   -0.0348   -0.0360   -0.0373   -0.0386   -0.0400   -0.0415   -0.0430   -0.0446   -0.0462   -0.0480
  Columns 201 through 210
   -0.0498   -0.0518   -0.0538   -0.0560   -0.0583   -0.0607   -0.0633   -0.0660   -0.0689   -0.0720
  Columns 211 through 220
   -0.0753   -0.0789   -0.0827   -0.0868   -0.0912   -0.0960   -0.1012   -0.1069   -0.1131   -0.1200
  Columns 221 through 230
   -0.1276   -0.1360   -0.1454   -0.1560   -0.1680   -0.1817   -0.1975   -0.2160   -0.2378   -0.2640
  Columns 231 through 240
   -0.2960   -0.3360   -0.3874   -0.4560   -0.5520   -0.6960   -0.9360   -1.4160   -2.8560      -Inf
index =
  Columns 1 through 16
    15    40    48    60    80    90    96   112   120   140   144   150   160   165   168   176
  Columns 17 through 32
   180   190   192   195   200   204   208   210   215   216   220   222   224   225   228   230
  Columns 33 through 41
   231   232   234   235   236   237   238   239   240
b =
  Columns 1 through 8
         112          96          90          80          60          48          40          15
  Columns 9 through 16
           0         -48         -60         -80        -120        -144        -160        -210
  Columns 17 through 24
        -240        -336        -360        -400        -480        -560        -660        -720
  Columns 25 through 32
        -912        -960       -1200       -1360       -1560       -1680       -2160       -2640
  Columns 33 through 40
       -2960       -3360       -4560       -5520       -6960       -9360      -14160      -28560
  Column 41
        -Inf
c =
  Columns 1 through 8
         113         104         102         100         100         102         104         113
  Columns 9 through 16
         120         148         156         170         200         219         232         274
  Columns 17 through 24
         300         386         408         445         520         596         692         750
  Columns 25 through 32
         937         984        1220        1378        1576        1695        2172        2650
  Columns 33 through 40
        2969        3368        4566        5525        6964        9363       14162       28561
  Column 41
         Inf
mine =
  Columns 1 through 8
          15          40          48          60          80          90          96         112
         112          96          90          80          60          48          40          15
         113         104         102         100         100         102         104         113
  Columns 9 through 16
         120         140         144         150         160         165         168         176
           0         -48         -60         -80        -120        -144        -160        -210
         120         148         156         170         200         219         232         274
  Columns 17 through 24
         180         190         192         195         200         204         208         210
        -240        -336        -360        -400        -480        -560        -660        -720
         300         386         408         445         520         596         692         750
  Columns 25 through 32
         215         216         220         222         224         225         228         230
        -912        -960       -1200       -1360       -1560       -1680       -2160       -2640
         937         984        1220        1378        1576        1695        2172        2650
  Columns 33 through 40
         231         232         234         235         236         237         238         239
       -2960       -3360       -4560       -5520       -6960       -9360      -14160      -28560
        2969        3368        4566        5525        6964        9363       14162       28561
  Column 41
         240
        -Inf
         Inf
ans =
  Columns 1 through 8
          25           8          12           0         -12          -8         -25         -15
         -16          -6         -10           0          10           6          16           8
          -9          -2          -2           0           2           2           9           7
  Columns 9 through 16
         -48         -12         -20         -40         -24         -16         -50         -30
          20           4           6          10           5           3           8           4
          28           8          14          30          19          13          42          26
  Columns 17 through 24
         -96         -24         -40         -80         -80        -100         -60        -192
          10           2           3           5           4           4           2           5
          86          22          37          75          76          96          58         187
  Columns 25 through 32
         -48        -240        -160        -200        -120        -480        -480        -320
           1           4           2           2           1           3           2           1
          47         236         158         198         119         477         478         319
  Columns 33 through 40
        -400       -1200        -960       -1440       -2400       -4800      -14400        -Inf
           1           2           1           1           1           1           1           1
         399        1198         959        1439        2399        4799       14399         Inf
ans =
     4
mine =
    15    40    48    60
   112    96    90    80
   113   104   102   100
C =
    [1x3 double]
C =
    [1x3 double]    [1x3 double]
C =
    [1x3 double]    [1x3 double]    [1x3 double]
C =
    [1x3 double]    [1x3 double]    [1x3 double]    [1x3 double]
3
Pass
 
%%
assert(isequal(right_triangle_sides(418),{ [57 176 185] }))
a =
  Columns 1 through 16
     1     2     3     4     5     6     7     8     9    10    11    12    13    14    15    16
  Columns 17 through 32
    17    18    19    20    21    22    23    24    25    26    27    28    29    30    31    32
  Columns 33 through 48
    33    34    35    36    37    38    39    40    41    42    43    44    45    46    47    48
  Columns 49 through 64
    49    50    51    52    53    54    55    56    57    58    59    60    61    62    63    64
  Columns 65 through 80
    65    66    67    68    69    70    71    72    73    74    75    76    77    78    79    80
  Columns 81 through 96
    81    82    83    84    85    86    87    88    89    90    91    92    93    94    95    96
  Columns 97 through 112
    97    98    99   100   101   102   103   104   105   106   107   108   109   110   111   112
  Columns 113 through 128
   113   114   115   116   117   118   119   120   121   122   123   124   125   126   127   128
  Columns 129 through 144
   129   130   131   132   133   134   135   136   137   138   139   140   141   142   143   144
  Columns 145 through 160
   145   146   147   148   149   150   151   152   153   154   155   156   157   158   159   160
  Columns 161 through 176
   161   162   163   164   165   166   167   168   169   170   171   172   173   174   175   176
  Columns 177 through 192
   177   178   179   180   181   182   183   184   185   186   187   188   189   190   191   192
  Columns 193 through 208
   193   194   195   196   197   198   199   200   201   202   203   204   205   206   207   208
  Columns 209 through 224
   209   210   211   212   213   214   215   216   217   218   219   220   221   222   223   224
  Columns 225 through 240
   225   226   227   228   229   230   231   232   233   234   235   236   237   238   239   240
  Columns 241 through 256
   241   242   243   244   245   246   247   248   249   250   251   252   253   254   255   256
  Columns 257 through 272
   257   258   259   260   261   262   263   264   265   266   267   268   269   270   271   272
  Columns 273 through 288
   273   274   275   276   277   278   279   280   281   282   283   284   285   286   287   288
  Columns 289 through 304
   289   290   291   292   293   294   295   296   297   298   299   300   301   302   303   304
  Columns 305 through 320
   305   306   307   308   309   310   311   312   313   314   315   316   317   318   319   320
  Columns 321 through 336
   321   322   323   324   325   326   327   328   329   330   331   332   333   334   335   336
  Columns 337 through 352
   337   338   339   340   341   342   343   344   345   346   347   348   349   350   351   352
  Columns 353 through 368
   353   354   355   356   357   358   359   360   361   362   363   364   365   366   367   368
  Columns 369 through 384
   369   370   371   372   373   374   375   376   377   378   379   380   381   382   383   384
  Columns 385 through 400
   385   386   387   388   389   390   391   392   393   394   395   396   397   398   399   400
  Columns 401 through 416
   401   402   403   404   405   406   407   408   409   410   411   412   413   414   415   416
  Columns 417 through 418
   417   418
b =
   1.0e+04 *
  Columns 1 through 10
    0.0208    0.0208    0.0207    0.0207    0.0206    0.0206    0.0205    0.0205    0.0204    0.0204
  Columns 11 through 20
    0.0203    0.0203    0.0202    0.0202    0.0201    0.0201    0.0200    0.0200    0.0199    0.0198
  Columns 21 through 30
    0.0198    0.0197    0.0197    0.0196    0.0196    0.0195    0.0195    0.0194    0.0193    0.0193
  Columns 31 through 40
    0.0192    0.0192    0.0191    0.0190    0.0190    0.0189    0.0189    0.0188    0.0187    0.0187
  Columns 41 through 50
    0.0186    0.0186    0.0185    0.0184    0.0184    0.0183    0.0183    0.0182    0.0181    0.0181
  Columns 51 through 60
    0.0180    0.0179    0.0179    0.0178    0.0177    0.0177    0.0176    0.0175    0.0175    0.0174
  Columns 61 through 70
    0.0173    0.0173    0.0172    0.0171    0.0171    0.0170    0.0169    0.0168    0.0168    0.0167
  Columns 71 through 80
    0.0166    0.0166    0.0165    0.0164    0.0163    0.0163    0.0162    0.0161    0.0160    0.0160
  Columns 81 through 90
    0.0159    0.0158    0.0157    0.0156    0.0156    0.0155    0.0154    0.0153    0.0152    0.0152
  Columns 91 through 100
    0.0151    0.0150    0.0149    0.0148    0.0148    0.0147    0.0146    0.0145    0.0144    0.0143
  Columns 101 through 110
    0.0142    0.0142    0.0141    0.0140    0.0139    0.0138    0.0137    0.0136    0.0135    0.0134
  Columns 111 through 120
    0.0133    0.0133    0.0132    0.0131    0.0130    0.0129    0.0128    0.0127    0.0126    0.0125
  Columns 121 through 130
    0.0124    0.0123    0.0122    0.0121    0.0120    0.0119    0.0118    0.0117    0.0116    0.0115
  Columns 131 through 140
    0.0114    0.0113    0.0111    0.0110    0.0109    0.0108    0.0107    0.0106    0.0105    0.0104
  Columns 141 through 150
    0.0103    0.0101    0.0100    0.0099    0.0098    0.0097    0.0096    0.0094    0.0093    0.0092
  Columns 151 through 160
    0.0091    0.0090    0.0088    0.0087    0.0086    0.0085    0.0083    0.0082    0.0081    0.0079
  Columns 161 through 170
    0.0078    0.0077    0.0075    0.0074    0.0073    0.0071    0.0070    0.0069    0.0067    0.0066
  Columns 171 through 180
    0.0064    0.0063    0.0061    0.0060    0.0058    0.0057    0.0056    0.0054    0.0052    0.0051
  Columns 181 through 190
    0.0049    0.0048    0.0046    0.0045    0.0043    0.0041    0.0040    0.0038    0.0037    0.0035
  Columns 191 through 200
    0.0033    0.0031    0.0030    0.0028    0.0026    0.0024    0.0023    0.0021    0.0019    0.0017
  Columns 201 through 210
    0.0015    0.0014    0.0012    0.0010    0.0008    0.0006    0.0004    0.0002         0   -0.0002
  Columns 211 through 220
   -0.0004   -0.0006   -0.0008   -0.0010   -0.0012   -0.0014   -0.0017   -0.0019   -0.0021   -0.0023
  Columns 221 through 230
   -0.0025   -0.0028   -0.0030   -0.0032   -0.0035   -0.0037   -0.0039   -0.0042   -0.0044   -0.0047
  Columns 231 through 240
   -0.0049   -0.0052   -0.0054   -0.0057   -0.0059   -0.0062   -0.0065   -0.0067   -0.0070   -0.0073
  Columns 241 through 250
   -0.0076   -0.0078   -0.0081   -0.0084   -0.0087   -0.0090   -0.0093   -0.0096   -0.0099   -0.0102
  Columns 251 through 260
   -0.0105   -0.0108   -0.0111   -0.0115   -0.0118   -0.0121   -0.0125   -0.0128   -0.0131   -0.0135
  Columns 261 through 270
   -0.0138   -0.0142   -0.0146   -0.0149   -0.0153   -0.0157   -0.0161   -0.0164   -0.0168   -0.0172
  Columns 271 through 280
   -0.0176   -0.0180   -0.0184   -0.0189   -0.0193   -0.0197   -0.0202   -0.0206   -0.0211   -0.0215
  Columns 281 through 290
   -0.0220   -0.0224   -0.0229   -0.0234   -0.0239   -0.0244   -0.0249   -0.0254   -0.0259   -0.0265
  Columns 291 through 300
   -0.0270   -0.0275   -0.0281   -0.0287   -0.0292   -0.0298   -0.0304   -0.0310   -0.0316   -0.0322
  Columns 301 through 310
   -0.0329   -0.0335   -0.0342   -0.0348   -0.0355   -0.0362   -0.0369   -0.0376   -0.0383   -0.0391
  Columns 311 through 320
   -0.0398   -0.0406   -0.0414   -0.0422   -0.0430   -0.0438   -0.0447   -0.0456   -0.0464   -0.0473
  Columns 321 through 330
   -0.0483   -0.0492   -0.0502   -0.0511   -0.0521   -0.0532   -0.0542   -0.0553   -0.0564   -0.0575
  Columns 331 through 340
   -0.0586   -0.0598   -0.0610   -0.0622   -0.0635   -0.0647   -0.0661   -0.0674   -0.0688   -0.0702
  Columns 341 through 350
   -0.0717   -0.0732   -0.0747   -0.0763   -0.0779   -0.0795   -0.0812   -0.0830   -0.0848   -0.0867
  Columns 351 through 360
   -0.0886   -0.0906   -0.0926   -0.0947   -0.0969   -0.0991   -0.1014   -0.1038   -0.1063   -0.1088
  Columns 361 through 370
   -0.1115   -0.1142   -0.1170   -0.1200   -0.1230   -0.1262   -0.1295   -0.1329   -0.1365   -0.1402
  Columns 371 through 380
   -0.1441   -0.1481   -0.1523   -0.1568   -0.1614   -0.1662   -0.1713   -0.1766   -0.1822   -0.1881
  Columns 381 through 390
   -0.1943   -0.2009   -0.2078   -0.2151   -0.2229   -0.2312   -0.2400   -0.2494   -0.2594   -0.2702
  Columns 391 through 400
   -0.2818   -0.2942   -0.3076   -0.3222   -0.3380   -0.3553   -0.3742   -0.3950   -0.4180   -0.4435
  Columns 401 through 410
   -0.4721   -0.5042   -0.5406   -0.5822   -0.6302   -0.6862   -0.7524   -0.8318   -0.9289   -1.0502
  Columns 411 through 418
   -1.2062   -1.4142   -1.7054   -2.1423   -2.8703   -4.3263   -8.6944      -Inf
index =
    57   176   209   297   380   396   399   407   416   417   418
b =
  Columns 1 through 8
         176          57           0        -304       -1881       -3553       -4180       -7524
  Columns 9 through 11
      -43263      -86944        -Inf
c =
  Columns 1 through 8
         185         185         209         425        1919        3575        4199        7535
  Columns 9 through 11
       43265       86945         Inf
mine =
  Columns 1 through 8
          57         176         209         297         380         396         399         407
         176          57           0        -304       -1881       -3553       -4180       -7524
         185         185         209         425        1919        3575        4199        7535
  Columns 9 through 11
         416         417         418
      -43263      -86944        -Inf
       43265       86945         Inf
ans =
  Columns 1 through 8
           0         -57        -304       -1577       -1672        -627       -3344      -35739
           0          33          88          83          16           3           8           9
           0          24         216        1494        1656         624        3336       35730
  Columns 9 through 10
      -43681        -Inf
           1           1
       43680         Inf
ans =
     1
mine =
    57
   176
   185
C =
    [1x3 double]
4
Pass
 
%%
assert(isequal(right_triangle_sides(490),{ [140 147 203] }))
a =
  Columns 1 through 16
     1     2     3     4     5     6     7     8     9    10    11    12    13    14    15    16
  Columns 17 through 32
    17    18    19    20    21    22    23    24    25    26    27    28    29    30    31    32
  Columns 33 through 48
    33    34    35    36    37    38    39    40    41    42    43    44    45    46    47    48
  Columns 49 through 64
    49    50    51    52    53    54    55    56    57    58    59    60    61    62    63    64
  Columns 65 through 80
    65    66    67    68    69    70    71    72    73    74    75    76    77    78    79    80
  Columns 81 through 96
    81    82    83    84    85    86    87    88    89    90    91    92    93    94    95    96
  Columns 97 through 112
    97    98    99   100   101   102   103   104   105   106   107   108   109   110   111   112
  Columns 113 through 128
   113   114   115   116   117   118   119   120   121   122   123   124   125   126   127   128
  Columns 129 through 144
   129   130   131   132   133   134   135   136   137   138   139   140   141   142   143   144
  Columns 145 through 160
   145   146   147   148   149   150   151   152   153   154   155   156   157   158   159   160
  Columns 161 through 176
   161   162   163   164   165   166   167   168   169   170   171   172   173   174   175   176
  Columns 177 through 192
   177   178   179   180   181   182   183   184   185   186   187   188   189   190   191   192
  Columns 193 through 208
   193   194   195   196   197   198   199   200   201   202   203   204   205   206   207   208
  Columns 209 through 224
   209   210   211   212   213   214   215   216   217   218   219   220   221   222   223   224
  Columns 225 through 240
   225   226   227   228   229   230   231   232   233   234   235   236   237   238   239   240
  Columns 241 through 256
   241   242   243   244   245   246   247   248   249   250   251   252   253   254   255   256
  Columns 257 through 272
   257   258   259   260   261   262   263   264   265   266   267   268   269   270   271   272
  Columns 273 through 288
   273   274   275   276   277   278   279   280   281   282   283   284   285   286   287   288
  Columns 289 through 304
   289   290   291   292   293   294   295   296   297   298   299   300   301   302   303   304
  Columns 305 through 320
   305   306   307   308   309   310   311   312   313   314   315   316   317   318   319   320
  Columns 321 through 336
   321   322   323   324   325   326   327   328   329   330   331   332   333   334   335   336
  Columns 337 through 352
   337   338   339   340   341   342   343   344   345   346   347   348   349   350   351   352
  Columns 353 through 368
   353   354   355   356   357   358   359   360   361   362   363   364   365   366   367   368
  Columns 369 through 384
   369   370   371   372   373   374   375   376   377   378   379   380   381   382   383   384
  Columns 385 through 400
   385   386   387   388   389   390   391   392   393   394   395   396   397   398   399   400
  Columns 401 through 416
   401   402   403   404   405   406   407   408   409   410   411   412   413   414   415   416
  Columns 417 through 432
   417   418   419   420   421   422   423   424   425   426   427   428   429   430   431   432
  Columns 433 through 448
   433   434   435   436   437   438   439   440   441   442   443   444   445   446   447   448
  Columns 449 through 464
   449   450   451   452   453   454   455   456   457   458   459   460   461   462   463   464
  Columns 465 through 480
   465   466   467   468   469   470   471   472   473   474   475   476   477   478   479   480
  Columns 481 through 490
   481   482   483   484   485   486   487   488   489   490
b =
   1.0e+05 *
  Columns 1 through 10
    0.0024    0.0024    0.0024    0.0024    0.0024    0.0024    0.0024    0.0024    0.0024    0.0024
  Columns 11 through 20
    0.0024    0.0024    0.0024    0.0024    0.0024    0.0024    0.0024    0.0024    0.0024    0.0023
  Columns 21 through 30
    0.0023    0.0023    0.0023    0.0023    0.0023    0.0023    0.0023    0.0023    0.0023    0.0023
  Columns 31 through 40
    0.0023    0.0023    0.0023    0.0023    0.0023    0.0023    0.0022    0.0022    0.0022    0.0022
  Columns 41 through 50
    0.0022    0.0022    0.0022    0.0022    0.0022    0.0022    0.0022    0.0022    0.0022    0.0022
  Columns 51 through 60
    0.0022    0.0022    0.0022    0.0021    0.0021    0.0021    0.0021    0.0021    0.0021    0.0021
  Columns 61 through 70
    0.0021    0.0021    0.0021    0.0021    0.0021    0.0021    0.0021    0.0021    0.0020    0.0020
  Columns 71 through 80
    0.0020    0.0020    0.0020    0.0020    0.0020    0.0020    0.0020    0.0020    0.0020    0.0020
  Columns 81 through 90
    0.0020    0.0020    0.0020    0.0019    0.0019    0.0019    0.0019    0.0019    0.0019    0.0019
  Columns 91 through 100
    0.0019    0.0019    0.0019    0.0019    0.0019    0.0019    0.0018    0.0018    0.0018    0.0018
  Columns 101 through 110
    0.0018    0.0018    0.0018    0.0018    0.0018    0.0018    0.0018    0.0018    0.0017    0.0017
  Columns 111 through 120
    0.0017    0.0017    0.0017    0.0017    0.0017    0.0017    0.0017    0.0017    0.0017    0.0017
  Columns 121 through 130
    0.0016    0.0016    0.0016    0.0016    0.0016    0.0016    0.0016    0.0016    0.0016    0.0016
  Columns 131 through 140
    0.0016    0.0015    0.0015    0.0015    0.0015    0.0015    0.0015    0.0015    0.0015    0.0015
  Columns 141 through 150
    0.0015    0.0015    0.0014    0.0014    0.0014    0.0014    0.0014    0.0014    0.0014    0.0014
  Columns 151 through 160
    0.0014    0.0013    0.0013    0.0013    0.0013    0.0013    0.0013    0.0013    0.0013    0.0013
  Columns 161 through 170
    0.0013    0.0012    0.0012    0.0012    0.0012    0.0012    0.0012    0.0012    0.0012    0.0011
  Columns 171 through 180
    0.0011    0.0011    0.0011    0.0011    0.0011    0.0011    0.0011    0.0011    0.0010    0.0010
  Columns 181 through 190
    0.0010    0.0010    0.0010    0.0010    0.0010    0.0010    0.0009    0.0009    0.0009    0.0009
  Columns 191 through 200
    0.0009    0.0009    0.0009    0.0008    0.0008    0.0008    0.0008    0.0008    0.0008    0.0008
  Columns 201 through 210
    0.0007    0.0007    0.0007    0.0007    0.0007    0.0007    0.0007    0.0006    0.0006    0.0006
  Columns 211 through 220
    0.0006    0.0006    0.0006    0.0006    0.0005    0.0005    0.0005    0.0005    0.0005    0.0005
  Columns 221 through 230
    0.0004    0.0004    0.0004    0.0004    0.0004    0.0004    0.0003    0.0003    0.0003    0.0003
  Columns 231 through 240
    0.0003    0.0002    0.0002    0.0002    0.0002    0.0002    0.0002    0.0001    0.0001    0.0001
  Columns 241 through 250
    0.0001    0.0001    0.0000    0.0000         0   -0.0000   -0.0000   -0.0001   -0.0001   -0.0001
  Columns 251 through 260
   -0.0001   -0.0001   -0.0002   -0.0002   -0.0002   -0.0002   -0.0003   -0.0003   -0.0003   -0.0003
  Columns 261 through 270
   -0.0003   -0.0004   -0.0004   -0.0004   -0.0004   -0.0005   -0.0005   -0.0005   -0.0005   -0.0006
  Columns 271 through 280
   -0.0006   -0.0006   -0.0006   -0.0007   -0.0007   -0.0007   -0.0007   -0.0008   -0.0008   -0.0008
  Columns 281 through 290
   -0.0008   -0.0009   -0.0009   -0.0009   -0.0010   -0.0010   -0.0010   -0.0010   -0.0011   -0.0011
  Columns 291 through 300
   -0.0011   -0.0012   -0.0012   -0.0012   -0.0013   -0.0013   -0.0013   -0.0014   -0.0014   -0.0014
  Columns 301 through 310
   -0.0015   -0.0015   -0.0015   -0.0016   -0.0016   -0.0016   -0.0017   -0.0017   -0.0017   -0.0018
  Columns 311 through 320
   -0.0018   -0.0018   -0.0019   -0.0019   -0.0020   -0.0020   -0.0020   -0.0021   -0.0021   -0.0022
  Columns 321 through 330
   -0.0022   -0.0022   -0.0023   -0.0023   -0.0024   -0.0024   -0.0025   -0.0025   -0.0026   -0.0026
  Columns 331 through 340
   -0.0027   -0.0027   -0.0027   -0.0028   -0.0028   -0.0029   -0.0029   -0.0030   -0.0031   -0.0031
  Columns 341 through 350
   -0.0032   -0.0032   -0.0033   -0.0033   -0.0034   -0.0034   -0.0035   -0.0036   -0.0036   -0.0037
  Columns 351 through 360
   -0.0037   -0.0038   -0.0039   -0.0039   -0.0040   -0.0041   -0.0041   -0.0042   -0.0043   -0.0043
  Columns 361 through 370
   -0.0044   -0.0045   -0.0046   -0.0046   -0.0047   -0.0048   -0.0049   -0.0049   -0.0050   -0.0051
  Columns 371 through 380
   -0.0052   -0.0053   -0.0054   -0.0054   -0.0055   -0.0056   -0.0057   -0.0058   -0.0059   -0.0060
  Columns 381 through 390
   -0.0061   -0.0062   -0.0063   -0.0064   -0.0065   -0.0066   -0.0068   -0.0069   -0.0070   -0.0071
  Columns 391 through 400
   -0.0072   -0.0073   -0.0075   -0.0076   -0.0077   -0.0079   -0.0080   -0.0081   -0.0083   -0.0084
  Columns 401 through 410
   -0.0086   -0.0087   -0.0089   -0.0091   -0.0092   -0.0094   -0.0096   -0.0097   -0.0099   -0.0101
  Columns 411 through 420
   -0.0103   -0.0105   -0.0107   -0.0109   -0.0111   -0.0113   -0.0115   -0.0118   -0.0120   -0.0123
  Columns 421 through 430
   -0.0125   -0.0128   -0.0130   -0.0133   -0.0136   -0.0139   -0.0142   -0.0145   -0.0148   -0.0151
  Columns 431 through 440
   -0.0154   -0.0158   -0.0162   -0.0165   -0.0169   -0.0173   -0.0178   -0.0182   -0.0186   -0.0191
  Columns 441 through 450
   -0.0196   -0.0201   -0.0206   -0.0212   -0.0218   -0.0224   -0.0230   -0.0237   -0.0244   -0.0251
  Columns 451 through 460
   -0.0259   -0.0267   -0.0275   -0.0284   -0.0294   -0.0304   -0.0315   -0.0326   -0.0338   -0.0351
  Columns 461 through 470
   -0.0365   -0.0380   -0.0396   -0.0413   -0.0431   -0.0451   -0.0473   -0.0497   -0.0523   -0.0551
  Columns 471 through 480
   -0.0583   -0.0618   -0.0657   -0.0701   -0.0751   -0.0809   -0.0874   -0.0951   -0.1042   -0.1152
  Columns 481 through 490
   -0.1285   -0.1452   -0.1666   -0.1952   -0.2352   -0.2952   -0.3953   -0.5954   -1.1956      -Inf
index =
  Co...
5
Pass
 
%%
assert(isequal(right_triangle_sides(112),{ [14 48 50] }))
a =
  Columns 1 through 16
     1     2     3     4     5     6     7     8     9    10    11    12    13    14    15    16
  Columns 17 through 32
    17    18    19    20    21    22    23    24    25    26    27    28    29    30    31    32
  Columns 33 through 48
    33    34    35    36    37    38    39    40    41    42    43    44    45    46    47    48
  Columns 49 through 64
    49    50    51    52    53    54    55    56    57    58    59    60    61    62    63    64
  Columns 65 through 80
    65    66    67    68    69    70    71    72    73    74    75    76    77    78    79    80
  Columns 81 through 96
    81    82    83    84    85    86    87    88    89    90    91    92    93    94    95    96
  Columns 97 through 112
    97    98    99   100   101   102   103   104   105   106   107   108   109   110   111   112
b =
   1.0e+03 *
  Columns 1 through 10
    0.0555    0.0550    0.0545    0.0539    0.0534    0.0528    0.0523    0.0517    0.0511    0.0505
  Columns 11 through 20
    0.0499    0.0493    0.0486    0.0480    0.0473    0.0467    0.0460    0.0453    0.0446    0.0438
  Columns 21 through 30
    0.0431    0.0423    0.0415    0.0407    0.0399    0.0391    0.0382    0.0373    0.0364    0.0355
  Columns 31 through 40
    0.0346    0.0336    0.0326    0.0316    0.0305    0.0295    0.0284    0.0272    0.0261    0.0249
  Columns 41 through 50
    0.0237    0.0224    0.0211    0.0198    0.0184    0.0170    0.0155    0.0140    0.0124    0.0108
  Columns 51 through 60
    0.0092    0.0075    0.0057    0.0039    0.0020         0   -0.0020   -0.0041   -0.0063   -0.0086
  Columns 61 through 70
   -0.0110   -0.0134   -0.0160   -0.0187   -0.0214   -0.0243   -0.0274   -0.0305   -0.0339   -0.0373
  Columns 71 through 80
   -0.0410   -0.0448   -0.0488   -0.0531   -0.0575   -0.0622   -0.0672   -0.0725   -0.0781   -0.0840
  Columns 81 through 90
   -0.0903   -0.0971   -0.1043   -0.1120   -0.1203   -0.1292   -0.1389   -0.1493   -0.1607   -0.1731
  Columns 91 through 100
   -0.1867   -0.2016   -0.2181   -0.2364   -0.2569   -0.2800   -0.3061   -0.3360   -0.3705   -0.4107
  Columns 101 through 110
   -0.4582   -0.5152   -0.5849   -0.6720   -0.7840   -0.9333   -1.1424   -1.4560   -1.9787   -3.0240
  Columns 111 through 112
   -6.1600      -Inf
index =
    14    48    56    63    80    84    96    98   104   105   108   110   111   112
b =
  Columns 1 through 8
          48          14           0         -16         -84        -112        -280        -336
  Columns 9 through 14
        -672        -784       -1456       -3024       -6160        -Inf
c =
  Columns 1 through 8
          50          50          56          65         116         140         296         350
  Columns 9 through 14
         680         791        1460        3026        6161         Inf
mine =
  Columns 1 through 8
          14          48          56          63          80          84          96          98
          48          14           0         -16         -84        -112        -280        -336
          50          50          56          65         116         140         296         350
  Columns 9 through 14
         104         105         108         110         111         112
        -672        -784       -1456       -3024       -6160        -Inf
         680         791        1460        3026        6161         Inf
ans =
  Columns 1 through 8
           0         -14         -16         -68         -28        -168         -56        -336
           0           8           7          17           4          12           2           6
           0           6           9          51          24         156          54         330
  Columns 9 through 13
        -112        -672       -1568       -3136        -Inf
           1           3           2           1           1
         111         669        1566        3135         Inf
ans =
     1
mine =
    14
    48
    50
C =
    [1x3 double]
6
Pass
 
%%
assert(isequal(right_triangle_sides(390),{ [52 165 173] [65 156 169] }))
a =
  Columns 1 through 16
     1     2     3     4     5     6     7     8     9    10    11    12    13    14    15    16
  Columns 17 through 32
    17    18    19    20    21    22    23    24    25    26    27    28    29    30    31    32
  Columns 33 through 48
    33    34    35    36    37    38    39    40    41    42    43    44    45    46    47    48
  Columns 49 through 64
    49    50    51    52    53    54    55    56    57    58    59    60    61    62    63    64
  Columns 65 through 80
    65    66    67    68    69    70    71    72    73    74    75    76    77    78    79    80
  Columns 81 through 96
    81    82    83    84    85    86    87    88    89    90    91    92    93    94    95    96
  Columns 97 through 112
    97    98    99   100   101   102   103   104   105   106   107   108   109   110   111   112
  Columns 113 through 128
   113   114   115   116   117   118   119   120   121   122   123   124   125   126   127   128
  Columns 129 through 144
   129   130   131   132   133   134   135   136   137   138   139   140   141   142   143   144
  Columns 145 through 160
   145   146   147   148   149   150   151   152   153   154   155   156   157   158   159   160
  Columns 161 through 176
   161   162   163   164   165   166   167   168   169   170   171   172   173   174   175   176
  Columns 177 through 192
   177   178   179   180   181   182   183   184   185   186   187   188   189   190   191   192
  Columns 193 through 208
   193   194   195   196   197   198   199   200   201   202   203   204   205   206   207   208
  Columns 209 through 224
   209   210   211   212   213   214   215   216   217   218   219   220   221   222   223   224
  Columns 225 through 240
   225   226   227   228   229   230   231   232   233   234   235   236   237   238   239   240
  Columns 241 through 256
   241   242   243   244   245   246   247   248   249   250   251   252   253   254   255   256
  Columns 257 through 272
   257   258   259   260   261   262   263   264   265   266   267   268   269   270   271   272
  Columns 273 through 288
   273   274   275   276   277   278   279   280   281   282   283   284   285   286   287   288
  Columns 289 through 304
   289   290   291   292   293   294   295   296   297   298   299   300   301   302   303   304
  Columns 305 through 320
   305   306   307   308   309   310   311   312   313   314   315   316   317   318   319   320
  Columns 321 through 336
   321   322   323   324   325   326   327   328   329   330   331   332   333   334   335   336
  Columns 337 through 352
   337   338   339   340   341   342   343   344   345   346   347   348   349   350   351   352
  Columns 353 through 368
   353   354   355   356   357   358   359   360   361   362   363   364   365   366   367   368
  Columns 369 through 384
   369   370   371   372   373   374   375   376   377   378   379   380   381   382   383   384
  Columns 385 through 390
   385   386   387   388   389   390
b =
   1.0e+04 *
  Columns 1 through 10
    0.0194    0.0194    0.0193    0.0193    0.0192    0.0192    0.0191    0.0191    0.0190    0.0190
  Columns 11 through 20
    0.0189    0.0189    0.0188    0.0188    0.0187    0.0187    0.0186    0.0186    0.0185    0.0184
  Columns 21 through 30
    0.0184    0.0183    0.0183    0.0182    0.0182    0.0181    0.0180    0.0180    0.0179    0.0179
  Columns 31 through 40
    0.0178    0.0178    0.0177    0.0176    0.0176    0.0175    0.0175    0.0174    0.0173    0.0173
  Columns 41 through 50
    0.0172    0.0171    0.0171    0.0170    0.0170    0.0169    0.0168    0.0168    0.0167    0.0166
  Columns 51 through 60
    0.0166    0.0165    0.0164    0.0164    0.0163    0.0162    0.0162    0.0161    0.0160    0.0160
  Columns 61 through 70
    0.0159    0.0158    0.0157    0.0157    0.0156    0.0155    0.0155    0.0154    0.0153    0.0152
  Columns 71 through 80
    0.0152    0.0151    0.0150    0.0149    0.0149    0.0148    0.0147    0.0146    0.0145    0.0145
  Columns 81 through 90
    0.0144    0.0143    0.0142    0.0141    0.0141    0.0140    0.0139    0.0138    0.0137    0.0137
  Columns 91 through 100
    0.0136    0.0135    0.0134    0.0133    0.0132    0.0131    0.0130    0.0130    0.0129    0.0128
  Columns 101 through 110
    0.0127    0.0126    0.0125    0.0124    0.0123    0.0122    0.0121    0.0120    0.0119    0.0118
  Columns 111 through 120
    0.0117    0.0116    0.0115    0.0114    0.0113    0.0112    0.0111    0.0110    0.0109    0.0108
  Columns 121 through 130
    0.0107    0.0106    0.0105    0.0104    0.0103    0.0102    0.0101    0.0100    0.0099    0.0097
  Columns 131 through 140
    0.0096    0.0095    0.0094    0.0093    0.0092    0.0091    0.0089    0.0088    0.0087    0.0086
  Columns 141 through 150
    0.0085    0.0083    0.0082    0.0081    0.0080    0.0078    0.0077    0.0076    0.0074    0.0073
  Columns 151 through 160
    0.0072    0.0070    0.0069    0.0068    0.0066    0.0065    0.0064    0.0062    0.0061    0.0059
  Columns 161 through 170
    0.0058    0.0056    0.0055    0.0053    0.0052    0.0050    0.0049    0.0047    0.0046    0.0044
  Columns 171 through 180
    0.0043    0.0041    0.0040    0.0038    0.0036    0.0035    0.0033    0.0031    0.0030    0.0028
  Columns 181 through 190
    0.0026    0.0024    0.0023    0.0021    0.0019    0.0017    0.0015    0.0014    0.0012    0.0010
  Columns 191 through 200
    0.0008    0.0006    0.0004    0.0002         0   -0.0002   -0.0004   -0.0006   -0.0008   -0.0010
  Columns 201 through 210
   -0.0012   -0.0015   -0.0017   -0.0019   -0.0021   -0.0023   -0.0026   -0.0028   -0.0030   -0.0032
  Columns 211 through 220
   -0.0035   -0.0037   -0.0040   -0.0042   -0.0045   -0.0047   -0.0050   -0.0052   -0.0055   -0.0057
  Columns 221 through 230
   -0.0060   -0.0063   -0.0065   -0.0068   -0.0071   -0.0074   -0.0077   -0.0079   -0.0082   -0.0085
  Columns 231 through 240
   -0.0088   -0.0091   -0.0094   -0.0097   -0.0101   -0.0104   -0.0107   -0.0110   -0.0114   -0.0117
  Columns 241 through 250
   -0.0120   -0.0124   -0.0127   -0.0131   -0.0134   -0.0138   -0.0142   -0.0146   -0.0149   -0.0153
  Columns 251 through 260
   -0.0157   -0.0161   -0.0165   -0.0169   -0.0173   -0.0178   -0.0182   -0.0186   -0.0191   -0.0195
  Columns 261 through 270
   -0.0200   -0.0204   -0.0209   -0.0214   -0.0218   -0.0223   -0.0228   -0.0233   -0.0239   -0.0244
  Columns 271 through 280
   -0.0249   -0.0254   -0.0260   -0.0266   -0.0271   -0.0277   -0.0283   -0.0289   -0.0295   -0.0301
  Columns 281 through 290
   -0.0308   -0.0314   -0.0321   -0.0327   -0.0334   -0.0341   -0.0348   -0.0356   -0.0363   -0.0370
  Columns 291 through 300
   -0.0378   -0.0386   -0.0394   -0.0402   -0.0411   -0.0419   -0.0428   -0.0437   -0.0446   -0.0455
  Columns 301 through 310
   -0.0464   -0.0474   -0.0484   -0.0494   -0.0505   -0.0515   -0.0526   -0.0537   -0.0549   -0.0561
  Columns 311 through 320
   -0.0573   -0.0585   -0.0598   -0.0611   -0.0624   -0.0638   -0.0652   -0.0666   -0.0681   -0.0696
  Columns 321 through 330
   -0.0712   -0.0728   -0.0745   -0.0762   -0.0780   -0.0798   -0.0817   -0.0837   -0.0857   -0.0877
  Columns 331 through 340
   -0.0899   -0.0921   -0.0944   -0.0968   -0.0993   -0.1018   -0.1045   -0.1072   -0.1101   -0.1131
  Columns 341 through 350
   -0.1162   -0.1194   -0.1228   -0.1263   -0.1300   -0.1338   -0.1379   -0.1421   -0.1465   -0.1511
  Columns 351 through 360
   -0.1560   -0.1611   -0.1665   -0.1722   -0.1783   -0.1847   -0.1915   -0.1987   -0.2063   -0.2145
  Columns 361 through 370
   -0.2232   -0.2326   -0.2427   -0.2535   -0.2652   -0.2779   -0.2917   -0.3067   -0.3231   -0.3412
  Columns 371 through 380
   -0.3613   -0.3835   -0.4084   -0.4363   -0.4680   -0.5042   -0.5460   -0.5948   -0.6524   -0.7215
  Columns 381 through 390
   -0.8060   -0.9116   -1.0474   -1.2285   -1.4820   -1.8622   -2.4960   -3.7635   -7.5660      -Inf
index =
  Columns 1 through 16
    52    65   156   165   195   221   240   260   273   300   312   315   325   340   345   351
  Columns 17 through 30
   360   364   365   372   375   377   380   381   384   385   387   388   389   390
b =
  Columns 1 through 8
         165         156          65          52           0         -60        -117        -195
  Columns 9 through 16
        -260        -455        -585        -624        -780       -1131       -1300       -1560
  Columns 17 through 24
       -2145       -2535       -2652       -3835       -4680       -5460       -7215       -8060
  Columns 25 through 30
      -12285      -14820      -24960      -37635      -75660        -Inf
c =
  Columns 1 through 8
         173         169         169         173         195         229         267         325
  Columns 9 through 16
         377         545         663         699         845        1181        1345        1599
  Columns 17 through 24
        2175        2561        2677        3853        4695        5473        7225        8069
  Columns 25 through 30
       12291       14825       24963       37637       75661         Inf
mine =
  Columns 1 through 8
          52          65         156         165         195         221         240         260
         165         156          65          52           0         -60        -117        -195
         173         169         169         173         195         229         267         325
  Columns 9 through 16
         273         300         312         315         325         340         345         351
        -260        -455        -585        -624        -780       -1131       -1300       -1560
         377         545         663         699         845        1181        1345        1599
  Columns 17 through 24
         360         364         365         372         375         377         380         381
       -2145       -2535       -2652       -3835       -4680       -5460       -7215       -8060
        2175        2561        2...
7
Pass
 
%%
assert(isequal(right_triangle_sides(132),{ [11 60 61] [33 44 55] }))
a =
  Columns 1 through 16
     1     2     3     4     5     6     7     8     9    10    11    12    13    14    15    16
  Columns 17 through 32
    17    18    19    20    21    22    23    24    25    26    27    28    29    30    31    32
  Columns 33 through 48
    33    34    35    36    37    38    39    40    41    42    43    44    45    46    47    48
  Columns 49 through 64
    49    50    51    52    53    54    55    56    57    58    59    60    61    62    63    64
  Columns 65 through 80
    65    66    67    68    69    70    71    72    73    74    75    76    77    78    79    80
  Columns 81 through 96
    81    82    83    84    85    86    87    88    89    90    91    92    93    94    95    96
  Columns 97 through 112
    97    98    99   100   101   102   103   104   105   106   107   108   109   110   111   112
  Columns 113 through 128
   113   114   115   116   117   118   119   120   121   122   123   124   125   126   127   128
  Columns 129 through 132
   129   130   131   132
b =
   1.0e+03 *
  Columns 1 through 10
    0.0655    0.0650    0.0645    0.0639    0.0634    0.0629    0.0623    0.0617    0.0612    0.0606
  Columns 11 through 20
    0.0600    0.0594    0.0588    0.0582    0.0575    0.0569    0.0562    0.0556    0.0549    0.0542
  Columns 21 through 30
    0.0535    0.0528    0.0521    0.0513    0.0506    0.0498    0.0490    0.0482    0.0474    0.0466
  Columns 31 through 40
    0.0457    0.0449    0.0440    0.0431    0.0422    0.0413    0.0403    0.0393    0.0383    0.0373
  Columns 41 through 50
    0.0363    0.0352    0.0341    0.0330    0.0319    0.0307    0.0295    0.0283    0.0270    0.0258
  Columns 51 through 60
    0.0244    0.0231    0.0217    0.0203    0.0189    0.0174    0.0158    0.0143    0.0127    0.0110
  Columns 61 through 70
    0.0093    0.0075    0.0057    0.0039    0.0020         0   -0.0020   -0.0041   -0.0063   -0.0085
  Columns 71 through 80
   -0.0108   -0.0132   -0.0157   -0.0182   -0.0208   -0.0236   -0.0264   -0.0293   -0.0324   -0.0355
  Columns 81 through 90
   -0.0388   -0.0422   -0.0458   -0.0495   -0.0534   -0.0574   -0.0616   -0.0660   -0.0706   -0.0754
  Columns 91 through 100
   -0.0805   -0.0858   -0.0914   -0.0973   -0.1035   -0.1100   -0.1169   -0.1242   -0.1320   -0.1403
  Columns 101 through 110
   -0.1490   -0.1584   -0.1684   -0.1791   -0.1907   -0.2031   -0.2165   -0.2310   -0.2468   -0.2640
  Columns 111 through 120
   -0.2829   -0.3036   -0.3265   -0.3520   -0.3805   -0.4125   -0.4488   -0.4903   -0.5382   -0.5940
  Columns 121 through 130
   -0.6600   -0.7392   -0.8360   -0.9570   -1.1126   -1.3200   -1.6104   -2.0460   -2.7720   -4.2240
  Columns 131 through 132
   -8.5800      -Inf
index =
  Columns 1 through 16
    11    33    44    60    66    88    96    99   108   110   114   120   121   123   124   126
  Columns 17 through 21
   128   129   130   131   132
b =
  Columns 1 through 8
          60          44          33          11           0         -66        -110        -132
  Columns 9 through 16
        -231        -264        -352        -594        -660        -836        -957       -1320
  Columns 17 through 21
       -2046       -2772       -4224       -8580        -Inf
c =
  Columns 1 through 8
          61          55          55          61          66         110         146         165
  Columns 9 through 16
         255         286         370         606         671         845         965        1326
  Columns 17 through 21
        2050        2775        4226        8581         Inf
mine =
  Columns 1 through 8
          11          33          44          60          66          88          96          99
          60          44          33          11           0         -66        -110        -132
          61          55          55          61          66         110         146         165
  Columns 9 through 16
         108         110         114         120         121         123         124         126
        -231        -264        -352        -594        -660        -836        -957       -1320
         255         286         370         606         671         845         965        1326
  Columns 17 through 21
         128         129         130         131         132
       -2046       -2772       -4224       -8580        -Inf
        2050        2775        4226        8581         Inf
ans =
  Columns 1 through 8
          22           0         -22         -11         -66         -44         -22         -99
         -16           0          16           6          22           8           3           9
          -6           0           6           5          44          36          19          90
  Columns 9 through 16
         -33         -88        -242         -66        -176        -121        -363        -726
           2           4           6           1           2           1           2           2
          31          84         236          65         174         120         361         724
  Columns 17 through 20
        -726       -1452       -4356        -Inf
           1           1           1           1
         725        1451        4355         Inf
ans =
     2
mine =
    11    33
    60    44
    61    55
C =
    [1x3 double]
C =
    [1x3 double]    [1x3 double]
8
Fail
 
%%
assert(isequal(right_triangle_sides(576),{ [64 252 260] [144 192 240] }))
a =
  Columns 1 through 16
     1     2     3     4     5     6     7     8     9    10    11    12    13    14    15    16
  Columns 17 through 32
    17    18    19    20    21    22    23    24    25    26    27    28    29    30    31    32
  Columns 33 through 48
    33    34    35    36    37    38    39    40    41    42    43    44    45    46    47    48
  Columns 49 through 64
    49    50    51    52    53    54    55    56    57    58    59    60    61    62    63    64
  Columns 65 through 80
    65    66    67    68    69    70    71    72    73    74    75    76    77    78    79    80
  Columns 81 through 96
    81    82    83    84    85    86    87    88    89    90    91    92    93    94    95    96
  Columns 97 through 112
    97    98    99   100   101   102   103   104   105   106   107   108   109   110   111   112
  Columns 113 through 128
   113   114   115   116   117   118   119   120   121   122   123   124   125   126   127   128
  Columns 129 through 144
   129   130   131   132   133   134   135   136   137   138   139   140   141   142   143   144
  Columns 145 through 160
   145   146   147   148   149   150   151   152   153   154   155   156   157   158   159   160
  Columns 161 through 176
   161   162   163   164   165   166   167   168   169   170   171   172   173   174   175   176
  Columns 177 through 192
   177   178   179   180   181   182   183   184   185   186   187   188   189   190   191   192
  Columns 193 through 208
   193   194   195   196   197   198   199   200   201   202   203   204   205   206   207   208
  Columns 209 through 224
   209   210   211   212   213   214   215   216   217   218   219   220   221   222   223   224
  Columns 225 through 240
   225   226   227   228   229   230   231   232   233   234   235   236   237   238   239   240
  Columns 241 through 256
   241   242   243   244   245   246   247   248   249   250   251   252   253   254   255   256
  Columns 257 through 272
   257   258   259   260   261   262   263   264   265   266   267   268   269   270   271   272
  Columns 273 through 288
   273   274   275   276   277   278   279   280   281   282   283   284   285   286   287   288
  Columns 289 through 304
   289   290   291   292   293   294   295   296   297   298   299   300   301   302   303   304
  Columns 305 through 320
   305   306   307   308   309   310   311   312   313   314   315   316   317   318   319   320
  Columns 321 through 336
   321   322   323   324   325   326   327   328   329   330   331   332   333   334   335   336
  Columns 337 through 352
   337   338   339   340   341   342   343   344   345   346   347   348   349   350   351   352
  Columns 353 through 368
   353   354   355   356   357   358   359   360   361   362   363   364   365   366   367   368
  Columns 369 through 384
   369   370   371   372   373   374   375   376   377   378   379   380   381   382   383   384
  Columns 385 through 400
   385   386   387   388   389   390   391   392   393   394   395   396   397   398   399   400
  Columns 401 through 416
   401   402   403   404   405   406   407   408   409   410   411   412   413   414   415   416
  Columns 417 through 432
   417   418   419   420   421   422   423   424   425   426   427   428   429   430   431   432
  Columns 433 through 448
   433   434   435   436   437   438   439   440   441   442   443   444   445   446   447   448
  Columns 449 through 464
   449   450   451   452   453   454   455   456   457   458   459   460   461   462   463   464
  Columns 465 through 480
   465   466   467   468   469   470   471   472   473   474   475   476   477   478   479   480
  Columns 481 through 496
   481   482   483   484   485   486   487   488   489   490   491   492   493   494   495   496
  Columns 497 through 512
   497   498   499   500   501   502   503   504   505   506   507   508   509   510   511   512
  Columns