MATLAB: How to convert a 80×60 cell of 8×8 block matrices into a matrix array of 640×480

cell2matrix

Hello, So my problem is that I have a cell array that has the dimensions 80×60 cells. In each cell contains a 8×8 matrix of numeric values. What I am trying to do is convert this cell array back into one large matrix array that will have the dimensions of 640×480. Here is what I have done.
bl = [8 8]; %Block size
size_IYdct = [480 640]; %Matrix size of 640x480
num_Ybl = ceil(size_IYdct ./ bl); %Num. of blocks in each dimension
%Converts matrix into a cell with 8x8 blocks
C_Y = mat2cell(I_Ydct,repmat(bl(1),1,num_Ybl(1)), repmat(bl(2),1,num_Ybl(2)));
%The code below is where I get a problem since I cannot properly convert the cell to a matrix
%This ends up with a 8x8 matrix array when I need it to fill the array full of values with dimesions 640x480
for row = 1:60
for col = 1:80
DQ_Ymat = cell2mat(C_Y(row,col));
end
end
Thank you

Best Answer

DQ_Ymat = cell2mat(C_Y);
Please read about function cell2mat:
doc cell2mat