转换为单行矩阵 [英] convert into a single row matrix
本文介绍了转换为单行矩阵的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个矩阵,说a = [1 5 9;7 8 5; 7 1 4];
我想制作一个a
的线性矩阵,即a1 = [1 5 9 7 8 5 7 1 4];
I want to make a linear matrix of a
i.e., a1 = [1 5 9 7 8 5 7 1 4];
推荐答案
a'(:)' %# Octave
b= a'; b(:)' %# Matlab
Added, more verbose variations may be occasionally practical as well:
a'(ind2sub([3 3], 1: 9))
permute(a, [2 1])(ind2sub([3 3], 1: 9))
此处permute(a, [2 1])
现在等同于a.'
.
这篇关于转换为单行矩阵的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文