MATLAB like eye - Identity matrix
(n: usize)
| 1859 | |
| 1860 | /// MATLAB like eye - Identity matrix |
| 1861 | pub fn ceye(n: usize) -> ComplexMatrix { |
| 1862 | let mut m = cmatrix(vec![Complex::zero(); n * n], n, n, Shape::Row); |
| 1863 | for i in 0..n { |
| 1864 | m[(i, i)] = Complex::one(); |
| 1865 | } |
| 1866 | m |
| 1867 | } |
| 1868 | |
| 1869 | // ============================================================================= |
| 1870 | // Linear Algebra |