Did I find the right examples for you? yes no

# numpy.matlib.repmat

All Samples(16)  |  Call(10)  |  Derive(0)  |  Import(6)
```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 times `a` is repeated along the first and second axes.

Returns(more...)
```

```        def repmat(a, m, n):
"""
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 times `a` is repeated along the first and second axes.

Returns
-------
out : ndarray
The result of repeating `a`.

Examples
--------
>>> import numpy.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]])

"""
a = asanyarray(a)
ndim = a.ndim
if ndim == 0:
origrows, origcols = (1, 1)
elif ndim == 1:
origrows, origcols = (1, a.shape[0])
else:
origrows, origcols = a.shape
rows = origrows * m
cols = origcols * n
c = a.reshape(1, a.size).repeat(m, 0).reshape(rows, origcols).repeat(n, 0)
return c.reshape(rows, cols)
```

```  """
from numpy import cos, sin, pi, arange, floor, ceil
from numpy.matlib import repmat
from scipy.fftpack import ifft2
dim = np.array(dim, dtype = float)
```
```  u /= dim[0]
# Reproduce these frequencies along ever row.
u = repmat(u, 1, dim[1])
# `v` is the set of frequencies along the second dimension.  For a square
# region it will be the transpose of `u`.
```
```  v /= dim[1]
# Reproduce these frequencies along ever column.
v = repmat(v, dim[0], 1)
# Generate the power spectrum.
# This causes intermittent RuntimeWarning: "divide by zero encountered in
```

```
import numpy as np
from numpy.matlib import repmat

from scipy.special import hankel1  # pylint: disable=E0611
```
```        N = self.N
M = points.size
d = (repmat(points.reshape(M, 1), 1, N) -
repmat(self.q.reshape(1, N), M, 1))
r = np.abs(d)
```
```            dr = d / r
if normal_derivative:
nx = repmat(normals.reshape(M, 1), 1, N)
nx /= np.abs(nx)
matrix_n = matrix_1 * (dr.real * nx.real + dr.imag * nx.imag)
```

```from scipy import ravel, zeros, outer, dot, tile, transpose, tensordot
from scipy.linalg import lstsq
from numpy.matlib import repmat

```
```        for sto in ss:
tmp = fMap - discountFactor * repmat(fMap[:, sto], numStates, 1).T
tmp2 = fMap * repmat(T[:, sto], dim, 1)
statMatrix += dot(tmp2, tmp.T)
statResidual += R[sto] * dot(fMap, T[:, sto])
```

```
import numpy as np
from numpy.matlib import repmat

from scipy.linalg import (  # pylint: disable=E0611
```
```                                                   normal_derivative=True)
Ablock = coeff_a * Ablock + coeff_b * Anblock
weights = repmat(self.sqrt_weights[m:mend], 1, b.N)
np.multiply(Ablock, weights, A[m:mend, n0:n1])
m += s.x.size
```

```
from scipy import dot, zeros, zeros_like, ones, mean, array, ravel, rand
from numpy.matlib import repmat

from pybrain.utilities import all_argmax
```

```import numpy as np
import pylab as plt
from numpy.matlib import repmat

# Plot lollipops (o's and sticks)
```

```def test_repmat():
a1 = np.arange(4)
x = np.matlib.repmat(a1, 2, 2)
y = np.array([[0, 1, 2, 3, 0, 1, 2, 3],
[0, 1, 2, 3, 0, 1, 2, 3]])
```

```def test_repmat():
a1 = np.arange(4)
x = np.matlib.repmat(a1, 2, 2)
y = np.array([[0, 1, 2, 3, 0, 1, 2, 3],
[0, 1, 2, 3, 0, 1, 2, 3]])
```

```def test_repmat():