home *** CD-ROM | disk | FTP | other *** search
/ Big Green CD 8 / BGCD_8_Dev.iso / NEXTSTEP / UNIX / Educational / R-0.49-MI / R-0.49-I / help / base / diag < prev    next >
Encoding:
Text File  |  1997-04-23  |  676 b   |  28 lines

  1.     
  2.     _M_a_t_r_i_x _D_i_a_g_o_n_a_l_s
  3.     
  4.          diag(x, nrow, ncol)
  5.          diag(x) <- value
  6.     
  7.     _V_a_l_u_e:
  8.     
  9.          If x is a matrix then diag(x) returns the diagonal of
  10.          x.  If x is a vector then x returns a diagonal matrix
  11.          whose diagonal is x.  If x is an integer then diag(x)
  12.          returns an identity matrix of order x.  The dimension
  13.          of the returned matrix can be specified by nrow and
  14.          ncol (the default is square).
  15.     
  16.          The assignment form sets the diagonal of the matrix x
  17.          to the given value(s).
  18.     
  19.     _S_e_e _A_l_s_o:
  20.     
  21.          matrix.
  22.     
  23.     _E_x_a_m_p_l_e_s:
  24.     
  25.          dim(diag(3))
  26.          diag(10,3,4) # guess what?
  27.     
  28.