Movatterモバイル変換


[0]ホーム

URL:


SciPy

numpy.matlib.repmat

numpy.matlib.repmat(a,m,n)[source]

Repeat a 0-D to 2-D array or matrix MxN times.

Parameters:

a : array_like

The array or matrix to be repeated.

m, n : int

The number of timesa is repeated along the first and second axes.

Returns:

out : ndarray

The result of repeatinga.

Examples

>>>importnumpy.matlib>>>a0=np.array(1)>>>np.matlib.repmat(a0,2,3)array([[1, 1, 1],       [1, 1, 1]])
>>>a1=np.arange(4)>>>np.matlib.repmat(a1,2,2)array([[0, 1, 2, 3, 0, 1, 2, 3],       [0, 1, 2, 3, 0, 1, 2, 3]])
>>>a2=np.asmatrix(np.arange(6).reshape(2,3))>>>np.matlib.repmat(a2,2,3)matrix([[0, 1, 2, 0, 1, 2, 0, 1, 2],        [3, 4, 5, 3, 4, 5, 3, 4, 5],        [0, 1, 2, 0, 1, 2, 0, 1, 2],        [3, 4, 5, 3, 4, 5, 3, 4, 5]])

Previous topic

numpy.matlib.identity

Next topic

numpy.matlib.rand

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

[8]ページ先頭

©2009-2025 Movatter.jp