save ten vectotors 784x1 in martix 784x10 in matlab

To save ten 784x1 vectors into a single 784x10 matrix in MATLAB, you can create an empty matrix of size 784x10, and assign each vector to a column of that matrix.

Here's some MATLAB code that demonstrates how to do this:

main.m
% Create an empty matrix to hold the vectors
matrix = zeros(784, 10);

% Assign each vector to a column of the matrix
matrix(:, 1) = vector1;
matrix(:, 2) = vector2;
matrix(:, 3) = vector3;
matrix(:, 4) = vector4;
matrix(:, 5) = vector5;
matrix(:, 6) = vector6;
matrix(:, 7) = vector7;
matrix(:, 8) = vector8;
matrix(:, 9) = vector9;
matrix(:, 10) = vector10;
360 chars
15 lines

In the code above, vector1 through vector10 are assumed to be the ten 784x1 vectors that you want to save in the matrix. The : operator specifies that we want to assign the entire vector to a particular column of the matrix. Note that the number of rows in each vector needs to match the number of rows in the matrix.

gistlibby LogSnag