|
Contents | Previous | Next | Subchapters |
| Syntax |
z = fill(x, m, n) |
z = fill(x,[m , n]) | |
| See Also | repmat , ones , zeros , fillrows , fillcols |
m x n subblocks
each of which is equal to x.
The return matrix has the same type as x,
has m times as many rows as x
and n times as many columns as x.
The (i,j)-th element of the return value is given by
z = x
i,j mod(i-1,m)+1 , mod(j-1,n)+1
The arguments m and n can be
integer, real, or double-precision.
If they are not integer,
only their integer
.
fill(1.5, 2, 3)
which returns
{
[ 1.5 , 1.5 , 1.5 ]
[ 1.5 , 1.5 , 1.5 ]
}
For a matrix x example, enter
fill([2.5 , 3.5], [2, 2])
which returns
{
[ 2.5 , 3.5 , 2.5 , 3.5 ]
[ 2.5 , 3.5 , 2.5 , 3.5 ]
}
x = fill(1, 0, 3)
print type(x), rowdim(x), coldim(x)
O-Matrix will respond
int 0 3
repmat instead of fill.
If in Mlmode you enter,
repmat([2.5 , 3.5], [2 , 2])
which returns
{
[ 2.5 , 3.5 , 2.5 , 3.5 ]
[ 2.5 , 3.5 , 2.5 , 3.5 ]
}