Problem 1100. Design matrix from eigenvalues

Write a function that takes one input argument n and outputs a (n x n) square matrix A with the following properties:

 -A has an eigenvalue of 3
 -all elements of A differ more than .5 from each other.
   For example



     4    -3     2
    -1     1     3
     0     5    -2

Solution Stats

28.21% Correct | 71.79% Incorrect
Last solution submitted on Aug 25, 2015

Problem Comments

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

MATLAB Academy

New to MATLAB?

Learn MATLAB today!