matlab中repmat函数的用法
2015-07-22 14:19
344 查看
B = repmat(A,m,n)
B = repmat(A,[m n])
B = repmat(A,[m n p...])
这是一个处理大矩阵且内容有重复时使用,其功能是以A的内容堆叠在(MxN)的矩阵B中,B矩阵的大小由MxN及A矩阵的内容决定,如果A是一个3x4x5的矩阵,有B = repmat(A,2,3)则最后的矩阵是6x12x5
例如:
>>B=repmat( [1 2;3 4],2,3)
B =
1 2 1
2 1 2
3 4 3
4 3 4
1 2 1 2 1
2
3 4 3 4 3
4
其结果变为4X6。A也可以置放文字串,如:
>>C=repmat(' Long live the king!', 2,2)
C =
Long live the king! Long live the king!
Long live the king! Long live the king!
也可置放其他的:
>> D=repmat(NaN,2,5)
D =
NaN NaN NaN NaN NaN
NaN NaN NaN NaN NaN
B = repmat(A,[m n])
B = repmat(A,[m n p...])
这是一个处理大矩阵且内容有重复时使用,其功能是以A的内容堆叠在(MxN)的矩阵B中,B矩阵的大小由MxN及A矩阵的内容决定,如果A是一个3x4x5的矩阵,有B = repmat(A,2,3)则最后的矩阵是6x12x5
例如:
>>B=repmat( [1 2;3 4],2,3)
B =
1 2 1
2 1 2
3 4 3
4 3 4
1 2 1 2 1
2
3 4 3 4 3
4
其结果变为4X6。A也可以置放文字串,如:
>>C=repmat(' Long live the king!', 2,2)
C =
Long live the king! Long live the king!
Long live the king! Long live the king!
也可置放其他的:
>> D=repmat(NaN,2,5)
D =
NaN NaN NaN NaN NaN
NaN NaN NaN NaN NaN
相关文章推荐
- matlab文件编译成库在C++环境下使用遇到的问题记录
- MATLAB数值取整
- set使用
- matlab norm的使用
- Matlab
- Matlab 常用绘图指令(二维图形)
- Matlab保存图像的方法
- matlab的调试方法
- matlab 二值图像 外轮廓提取
- matlab 已知函数值纵坐标值(Y值)获得对应的横坐标
- matlab产生正态分布样本
- matlab一行太长
- MATLAB Toolbox Path Cache is out of date and is not being used的解决
- Matlab 线性拟合 & 非线性拟合
- matlab的se是个什么东西
- MATLAB__LSB信息隐藏与提取
- MATLAB图像函数以及应用(第六章)边界问题
- matlab 图像函数以及运用(第十章)
- 在Windows下运行Felzenszwalb的Deformable Part Models(voc-release4.01)目标检测matlab源码
- Matlab 的内存分配机制