matlab之repmat
来源:互联网 发布:淘宝客如意投怎么设置 编辑:程序博客网 时间:2024/06/10 08:07
Replicate and tile arrayexpand all in pageSyntax
B = repmat(A,n)
exampleB = repmat(A,sz1,sz2,...,szN)
exampleB = repmat(A,sz)
exampleDescription
exampleB = repmat(A,n) returns an n-by-n tiling of A. The size of B is size(A) * n
exampleB = repmat(A,sz1,sz2,...,szN) specifies a list of scalars, sz1,sz2,...,szN, to describe an N-D tiling of A. The size of B is [size(A,1)*sz1, size(A,2)*sz2,...,size(A,n)*szN]. For example, repmat([1 2; 3 4],2,3) returns a 4-by-6 matrix.
exampleB = repmat(A,sz) specifies a row vector, sz, instead of a list of scalars, to describe the tiling of A. This syntax returns the same output as the previous syntax. For example, repmat([1 2; 3 4],[2 3]) returns the same result as repmat([1 2; 3 4],2,3).
Examples
collapse allReplicate and Tile a MatrixCreate a diagonal matrix.
A = diag([100 200 300])A =
100 0 0
0 200 0
0 0 300Create a 2-by-2 tiling of A.
B = repmat(A,2)B =
100 0 0 100 0 0
0 200 0 0 200 0
0 0 300 0 0 300
100 0 0 100 0 0
0 200 0 0 200 0
0 0 300 0 0 300Replicate and Tile an N-D ArrayCreate a 2-by-2-by-2 array.
A = zeros(2,2,2);
A(:,:,1) = diag([10 20]);
A(:,:,2) = diag([55 99]);
AA(:,:,1) =
10 0
0 20
A(:,:,2) =
55 0
0 99Create a 3-by-3 tiling of A.
B = repmat(A,3)B(:,:,1) =
10 0 10 0 10 0
0 20 0 20 0 20
10 0 10 0 10 0
0 20 0 20 0 20
10 0 10 0 10 0
0 20 0 20 0 20
B(:,:,2) =
55 0 55 0 55 0
0 99 0 99 0 99
55 0 55 0 55 0
0 99 0 99 0 99
55 0 55 0 55 0
0 99 0 99 0 99Vertical Stack of Row VectorsCreate a row vector.
A = 1:4A =
1 2 3 4
Create a vertical stack of four copies of A.
B = repmat(A,4,1)B =
1 2 3 4
1 2 3 4
1 2 3 4
1 2 3 4
B contains 4 copies of A in the first dimension and 1 copy in the second dimension. This result is equivalent to B = repmat(A,[4 1]).
Horizontal Stack of Column VectorsCreate a column vector.
A = (1:3)'A =
1
2
3Create a horizontal stack of four copies of A.
B = repmat(A,1,4)B =
1 1 1 1
2 2 2 2
3 3 3 3B contains 1 copy of A in the first dimension and 4 copies in the second dimension. This result is equivalent to B = repmat(A,[1 4]).
Replicate and Tile a Complex Scalar ValueDefine a complex scalar value.
A = 5+1i;Create a 3-by-2 tiling of A.
B = repmat(A,[3 2])B =
5.0000 + 1.0000i 5.0000 + 1.0000i
5.0000 + 1.0000i 5.0000 + 1.0000i
5.0000 + 1.0000i 5.0000 + 1.0000iB contains 3 copies of A in the first dimension and 2 copies in the second dimension. This result is equivalent to B = repmat(A,3,2).
Replicate and Tile a Cell ArrayCreate a cell array containing a string and numeric values.
A = {'Values'; 10; 105}A =
'Values'
[ 10]
[105]
Create a 3-by-2 tiling of A.
B = repmat(A,[3 2])B =
'Values' 'Values'
[ 10] [ 10]
[ 105] [ 105]
'Values' 'Values'
[ 10] [ 10]
[ 105] [ 105]
'Values' 'Values'
[ 10] [ 10]
[ 105] [ 105]
B contains 3 copies of A in the first dimension and 2 copies in the second dimension. This result is equivalent to B = repmat(A,3,2).
- matlab之repmat
- matlab之bsxfun与repmat
- Matlab ---repmat
- Matlab-repmat
- Matlab之repmat和reshape函数
- matlab学习笔记 repmat函数与kron函数之区别
- matlab中的repmat函数
- matlab repmat 重复数据
- Matlab 函数: repmat
- matlab中的repmat函数
- MATLAB中的repmat函数
- matlab repmat函数
- bsxfun vs. repmat in Matlab
- matlab矩阵复制函数:repmat
- MATLAB中repmat的运用
- MATLAB repmat函数的使用
- MATLAB reshape,repmat简单示例
- matlab矩阵复制函数:【repmat】
- 说明
- Hive初探
- 78. Subsets I & II
- Dialog背景透明
- String常用方法
- matlab之repmat
- 单选框(RadioButton)和复选框(CheckBox)
- nrf51822蓝牙学习笔记之GAP(通用属性配置文件)解读(二)
- Java 数据库 第四章 使用DML语句更改数据
- 模拟库中的字符串处理函数
- Java拼接字符串时,去掉最后一个多余的逗号 .
- Technocup 2017 - Elimination Round 1 (Rated for Div. 2) D. T-shirts Distribution 贪心、flows
- 【opencv小应用】Opencv FaceRecognizer类的简单使用(MFC)
- 一、Web应用和web.xml文件