Movatterモバイル変換


[0]ホーム

URL:


SciPy

numpy.matlib.identity

numpy.matlib.identity(n,dtype=None)[source]

Returns the square identity matrix of given size.

Parameters:

n : int

Size of the returned identity matrix.

dtype : data-type, optional

Data-type of the output. Defaults tofloat.

Returns:

out : matrix

n xn matrix with its main diagonal set to one,and all other elements zero.

See also

numpy.identity
Equivalent array function.
matlib.eye
More general matrix identity function.

Examples

>>>importnumpy.matlib>>>np.matlib.identity(3,dtype=int)matrix([[1, 0, 0],        [0, 1, 0],        [0, 0, 1]])

Previous topic

numpy.matlib.eye

Next topic

numpy.matlib.repmat

  • © Copyright 2008-2009, The Scipy community.
  • Last updated on Jun 10, 2017.
  • Created usingSphinx 1.5.3.

[8]ページ先頭

©2009-2025 Movatter.jp