How to get MatrixForm to display a row horizontally as a real row vector, and not vertically as a column vector?

Is there a way to make MatrixFormthe row vector display horizontally on the line, and not vertically, as is done for column vectors? How it sometimes confuses me. Do you think it will be difficult to write a wrapper around the shape of the matrix to customize this behavior?

For example, here is a 2 by 2 matrix. Rows are displayed in the same way as columns. Both are shown vertical.

enter image description here

Question: Is it possible to make MatrixFormdisplayed lines vectors arranged horizontally and not vertically?

Sorry, if this was asked before, a quick search shows nothing.

thank

update (1)

fyi, Matlab, , - . , .

enter image description here

(2) Hilderic, 3D- , . {}

enter image description here

+5
4

arrayname[[All,1]], arrayname[[1,All]], Part , MatrixForm , "" . , .

, , , , , () :

rowVector[a_List] := MatrixForm[{a}]
columnVector = MatrixForm   (*for symmetry*)

, .

+6

RowForm, :

RowForm[(m_)?VectorQ] := Row[{"(",Row[m,"  "], 
     ")"}, "\[MediumSpace]"]; 

RowForm[twoRowsMatrix[[All,1]]]

o.k.

, , :

twoRowsMatrix = {{a11, a12}, {a21, a22}};

TakeColumn[m_?MatrixQ, i_] := (Print[MatrixForm[#]]; #) &@m[[All, i]];
TakeRow[m_?MatrixQ, i_] := (Print[MatrixForm[{#}]]; #) &@m[[i]];
TakeColumn[twoRowsMatrix, 1]
TakeRow[twoRowsMatrix, 1]
+5

(), ,{}, TableForm Grid:

vec = {x, y, z};
TableForm[{vec, {}}]
Grid[{vec, {}}]
0

When I'm worried about this, I use {{a, b, c}} to specify the row a, b, c (they can be any list) and Transpose [{{a, b, c}}] to indicate the column a, b, c.

MatrixForm[a = RandomInteger[{0, 6}, {2, 2}]]
MatrixForm[b = RandomInteger[{0, 6}, {2, 2}]]
MatrixForm[c = RandomInteger[{0, 6}, {2, 2}]]
w = {a, b, c};
MatrixForm[w]
w = {{a, b, c}};
MatrixForm[w]
w = Transpose[{{a, b, c}}];
MatrixForm[w]
0
source

All Articles