home *** CD-ROM | disk | FTP | other *** search
-
- _M_a_t_r_i_x _D_i_a_g_o_n_a_l_s
-
- diag(x, nrow, ncol)
- diag(x) <- value
-
- _V_a_l_u_e:
-
- If x is a matrix then diag(x) returns the diagonal of
- x. If x is a vector then x returns a diagonal matrix
- whose diagonal is x. If x is an integer then diag(x)
- returns an identity matrix of order x. The dimension
- of the returned matrix can be specified by nrow and
- ncol (the default is square).
-
- The assignment form sets the diagonal of the matrix x
- to the given value(s).
-
- _S_e_e _A_l_s_o:
-
- matrix.
-
- _E_x_a_m_p_l_e_s:
-
- dim(diag(3))
- diag(10,3,4) # guess what?
-
-