transpose of vector in matlab

To transpose a vector in MATLAB, you can use either the transpose operator (') or the transpose function (transpose()).

Using transpose operator:

main.m
v = [1 2 3 4];
v_transpose = v';
33 chars
3 lines

Using transpose function:

main.m
v = [1 2 3 4];
v_transpose = transpose(v);
43 chars
3 lines

Both methods will give you the same result, which is a column vector that is the transpose of the original row vector.

gistlibby LogSnag