MATLAB: How to make 10 by 10 matrix into 1 by 100

matrixmatrix manipulation

for example i am extracting LBP of 10 images of size 100 by 100. LBP function returns feature vector size 100 by 100 . to store each fv of each image class consuming 100 rows and 100 columns,
i want to store each fv belonging to their respective class in one long row forming 100*100= 10,000 rows for each image class.
similarly i obtain fv 10 by 10,000 for 10 images.
how can i do that?

Best Answer

It depends on how you want the vector to be formatted.
The easiest way is:
fvv = fv(:);
where ‘fv’ is your original (100 x 100) matrix, and ‘fvv’ is a (10^4 x 1) vector. It is created as:
fvv = [fv(:,1); fv(:,2); ...; fv(:,100)];