Question: Simplest way to extract diagonal elements of a square symbolic matrix?

Simplest way to extract diagonal elements of a square symbolic matrix?

The diag command gives error

Error, (in linalg:-diag) parameters must be square matrices or scalars
 

Please Wait...