【发布时间】:2012-11-23 06:19:05
【问题描述】:
可能重复:
How do you concatenate the rows of a matrix into a vector in MATLAB?
如何将 MxN 矩阵转换为列,即使用某些东西而不是使用
B = A ( : )
?
【问题讨论】:
-
B = reshape(A, M*N, 1)。但是你为什么不想使用B = A(:)?它比reshape更快。 -
我认为是因为您不能将
(:)用于函数结果,只能用于命名变量。 -
@Mikhail 非常正确。 Matlab 相对于 Octave 的一个弱点...