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

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

This solution is outdated. To rescore this solution, log in.

Test Suite

Test
Code Input and Output
1
Pass
 
%%
x = [   36    2    7   27   20   25
         4   33    8   22   24   26
        32   10    3   23   28   21
         9   29   34   18   11   16
        31    6   35   13   15   17
         5   37   30   14   19   12];
y_correct = -9.7980e+00;
assert(isequal(last_eig(x),y_correct))

                    
2
Pass
 
%%
x = [  1     2     3     4     5
       2     3     4     5     6
      73    34    12    66     3
      92   298    22     1     4
       0     0     3     4     2  ];
y_correct = -3.06262 +  0.00000i;
assert(isequal(last_eig(x),y_correct))

                    
3
Pass
 
%%
x = [      3           5           0           8           0
          43          12          69          19          20
     1000000        1243        3941        1939        -100
        1951        1975        1977        1986           1
        3450         124         379         485         692
                                                              ];
y_correct = 684.5438;
assert(isequal(last_eig(x),y_correct))