Skip to main content

4.4) Creating Vectors And Matrices: Transpose


  • We can also make a row vector using the comma
  • [matlab]
    >> a=[13,26,38]
    a= 13 26 38
    [/matlab]

    Which is a 1x3 row vector

  • We can make a column vector using the semi-colon
  • [matlab]
    >> b=[13;26;38]
    b= 13
    26
    38
    [/matlab]

  • The transpose command ' (apostrophe) placed after the closing bracket or following a vector or array variable name, switches the dimensions. For example:
  • [matlab]
    >> b'=
    ans= 13 26 38
    >> c=[13;26;38]'
    c= 13 26 38
    [/matlab]