how to reshape following cell array i.e. reduced_traindata into 180 X 24 samples

I have 20 classes 9 images for P_train class and 3 images for P_test class. Four minutes with 6 columns having x,y,Crossing Number,theta(orientation,flag and permissible minute extracted from each image) so I get P_train i.e 720 X 6 and my train label is 180 X 1. When I use knnclassify group; length error occurred.

Is that possible to make group of rows and use index of that group in knnclassify ?

 clc;
    clear all;

    %% Training images
    id_test = 0;
    id_train = 0;

    for folder_idx = 1 : 20          % no of classes
    for i = 1 : 9                             % no of images per class

    thisfile = fullfile('train', num2str(folder_idx), [num2str(i) '.bmp ']); 
    B = imread(thisfile ); 
    X = double(B);

    X = imresize(X,[110 110],'bilinear');  %300 250
    id_train = id_train+1;
    traindata{id_train}=ext_vein(X,1);


    end 
    end
    %% Testing images
    d=[];
    for folder_idx = 1 : 20    %no of classes
    for i = 1 : 3                     % no of images per class

    thisfile = fullfile('test', num2str(folder_idx), [num2str(i) '.bmp ']); 
    B = imread(thisfile ); 
    X = double(B);

    X = imresize(X,[110 110],'bilinear');  %300 250

    id_test = id_test+1;
    testdata{id_test}=ext_vein(X,1);   

    end 
    end


     %% Reduced dimension of rows ( fixed to only 20 rows)

    reduced_testdata = cellfun(@(M) M(1:min(end,4), :), testdata, 'uniform', 0);
    reduced_traindata = cellfun(@(M) M(1:min(end,4), :), traindata, 'uniform',0);

    %     %% reshape
    %      [r c] = size(reduced_traindata);
    %      c = cell(r,c)
    %  d = reshape(c,[9,4]);

    %% saves cell array
    save('db1.mat','reduced_testdata');
    save('db2.mat','reduced_traindata');