One way to collect ten matrices of size 784x1 and store them in a single matrix of size 784x10 in MATLAB is by using a loop along with indexing.
main.m290 chars11 lines
In this example, we first initialize the matrix_collection
to a matrix of zeroes with dimensions 784x10. We then loop through each of the ten matrices that we want to collect, generating each 784x1 matrix using rand()
function. Finally, we store each generated matrix in the collection matrix using (:,i)
indexing.
At the end of the loop, matrix_collection
would contain ten 784x1 matrices stored as columns.
gistlibby LogSnag