matlab中repmat函数的用法
2016-02-29 08:19
585 查看
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重采样
- Matlab 模块库建立 S函数心得 小记
- R2014年号称流行,是否会在2016体现,give-up matlab,可视化
- MATLAB运算符
- VLFeat库matlab API接口
- Matlab melband的计算
- matlab-code folding功能 将某些行的代码折叠起来方便查看
- MATLAB图像处理:平面卫星图转换成立体球形图
- 最小二乘法拟合非线性函数及其Matlab/Excel 实现(转)
- 【转】三种方式在C++中调用matlab
- 基于数学建模的数学实验学习笔记一 MATLAB软件基础
- 【转】C++调用Matlab的.m文件
- matlab安装配置VLFeat库
- MATLAB的crack安装小曲
- [matlab]copy image
- MATLAB信号处理仿真-基带脉冲成形的数字滤波器
- 关联规则浅谈以及Apriori算法matlab实现
- 制作nc文件(Matlab)
- Matlab JPEG详细介绍
- matlab imread函数全说明