To create a matrix from two vectors in matlab, you can use the reshape
command. Here's an example:
main.m261 chars13 lines
Output:
main.m28 chars3 lines
In the example, the reshape
command takes the vector concatenated_vector
and reshapes it into a 2x3 matrix. The elements of the concatenated vector are placed in the resulting matrix by columns, hence in the example the first column of the matrix contains the first and fourth elements of the concatenated vector.
gistlibby LogSnag