next up previous contents
Next: 3.2.2 Element-by-element array operations Up: 3.2 Manipulating matrices and Previous: 3.2 Manipulating matrices and   Contents

3.2.1 Transposing

We can convert a row vector to a column vector (or vice versa) by transposing the array. The transpose operator is the ' symbol. Try printing the array $o$ to the screen, then try typing o'.
% Transposing arrays
o   % row vector
o'  % transposed to column vector

p  % column vector
p' % row vector

r = [2 3  % Define a 3x2 matrix
    4 1
    5 6]
r'        % transpose to a 2x3 matrix


Gus Hart 2005-01-28