MATLAB: I have a matrix q and i need the diagonal of qq’

matrix

I have a 5×5 matrix q and i need to obtain the diagonal of qq' anyone know how to do this and what qq' is?

Best Answer

In your Help Navigator, search for "arithmetic operators" and "diag"
diag(q*q')
is the same as
diag(q*transpose(q))
if all of the elements in q are real. Otherwise ' will give you the complex-conjugate transpose.