转换矩阵的一列
1322(30天)
显示旧的评论
你好,我已经把一个矩阵列向量组成的原始矩阵的所有列。我怎么能这样做呢?谢谢
5个评论
图像分析
2020年4月9日
你说“我要把一个矩阵列向量组成的所有原始矩阵的列”。I thought you meant you had a column vector and had to convert it to a matrix having the same number of columns as the original matrix from where the column vector came. In other words, I thought you meant "I have to convert a matrix of one column vector
成一个
所有原始矩阵的列组成的。”
看到你接受的答案,看来,你真正的意思是“我要把一个矩阵
成
一个列向量,由所有原始矩阵的列”。Leaving out seemingly minor words completely changes the interpretation of the question, as does their placement in the sentence.
接受的答案
安德烈Bobrov
2012年4月18日
yourvector = yourmatrix (:);
10评论
图像分析
2022年7月14日
编辑:图像分析
2022年7月14日
m =重塑(1:18,[],3)% 6行3列创建示例数据
(oldHeight、列)=尺寸(米)
%由插值矩阵高。
newHeight = 8;
[xq, yq] = meshgrid(1:列,linspace (1 oldHeight newHeight));
mTaller = interp2 (m, xq, yq)
流(mTaller的大小是由% d % d行列。\ n \ n”、大小(mTaller, 1),大小(mTaller, 2))
%由插值矩阵高。
newHeight = 3;
[xq, yq] = meshgrid(1:列,linspace (1 oldHeight newHeight));
mShorter = interp2 (m, xq, yq)
流(mShorter的大小是由% d % d行列。\ n”、大小(mShorter, 1),大小(mShorter, 2))
第一行/上和上/下将有相同的价值观,和更多,或更少,行插值在顶部和底部行,这样你有新的期望的高度。
更多的答案(4)
图像分析
2012年4月18日
如果你的列向量是“由原始矩阵的列”,然后使用重塑()命令把它从一个列向量回原来的二维矩阵。
matrix2D =重塑(columnVector列(行);
(反过来,如何让列向量在第一时间(你可能已经做了什么让你的向量)完成这样columnVector = fullMatrix (:))。