matlab中repmat函数的用法

发布时间:2025-09-11 00:02

JavaScript中的函数概念与使用方法 #生活知识# #编程教程#

转载:https://blog.csdn.net/facetosea1/article/details/83573859

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


转自:https://blog.csdn.net/anqier1009/article/details/5214978

网址:matlab中repmat函数的用法 https://klqsh.com/news/view/233339

相关内容

MATLAB高手必看:详解repmat函数,轻松实现数组复制
Matlab中的readlines函数:轻松读取文本文件的利器
MATLAB R2024b Windows 破解版下载
repmat
PHP strpos() 函数用法及示例
替换程序中的特定函数
PHP中使用strpos函数高效检测字符串中是否包含特定字符的方法详解
JavaScript decodeURI() 函数
怎样在Excel中计算三角函数值
PHP strpos() 函数

随便看看