Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个 3*3 的矩阵。我想在 Matlab 中将其转换为 6*1 向量。 当我使用 reshape 时,它有一个错误:
To RESHAPE the number of elements must not change.
所以我不能使用重塑。 您有什么建议可以帮助我将此矩阵转换为 6*1 向量吗?
只是为了说明 Mohsen 的评论,听起来您要求做这样的事情,这将涉及丢失部分原始矩阵。
>> A = [1 4 7; 2 5 8; 3 6 9]; >> B = A(1:6) B = 1 2 3 4 5 6 >> B = A(4:9) B = 4 5 6 7 8 9 >> B = A([1:3 7:9]) B = 1 2 3 7 8 9