In Matlab, you can use the reshape() function to reshape an array into a matrix. The syntax of the reshape() function is as follows:
main.m19 chars2 lines
where A is the array you want to reshape, m is the number of rows, and n is the number of columns.
Here's an example:
main.m94 chars7 lines
In this example, the reshape() function takes the array A and reshapes it into a 2x3 matrix B.
gistlibby LogSnag