MATLAB: How can i split an image into 25 blocks using for loop

split imagevector concatenation

i have a lot of images i need to split each image into blocks then i have to convert each block into one vector (now i have 25 vectors) i need to concatenate these vectors in one row vector finally i want to obtain an array each row in this array is a large vector(25 concatenated vectors) of one image how can i do this thanks in advance

Best Answer

B = im2col(your_image,[m n],'distinct');
B=B(:)';
m and n are the image block sizes.
B at the end is one row vector with your image blocks in it.