randh
Random Hermitian (complex symmetric) matrix.
Syntax
Section titled “Syntax”r = randh(n)r = randh(n, classname)Description
Section titled “Description”Returns an n×n complex Hermitian matrix — the diagonal is real-valued uniform [0, 1], off-diagonals are complex with both parts drawn from uniform [0, 1], and the lower triangle is the conjugate transpose of the upper. Useful as test data for Hermitian-matrix algorithms. The optional class-name selects between 'single', 'double', and 'longdouble' complex types.
Examples
Section titled “Examples”randh(4) % 4×4 Hermitian (complex)isequal(randh(3), randh(3)') % 1 (Hermitian → equals own conjugate transpose)