Challenge: Eigendecomposition

Solve this challenge on eigendecomposition in R.

We'll cover the following

Exercise

Write the R code needed to retrieve the diagonal factor of the eigendecomposition on the following square matrix:

A=[4825]A = \begin{bmatrix} 4 & 8 \\ 2 & 5 \end{bmatrix}

Sample input

This is what the sample input looks like:

c(4, 2, 8, 5)

Expected output

Here is what the expected output looks like:

         [,1]      [,2]
[1,] 8.531129 0.0000000
[2,] 0.000000 0.4688711

Use the code editor below to implement your solution.

Get hands-on with 1200+ tech skills courses.