MATLAB: How can i increase the size of labelling ….

Computer Vision Toolboxmatrices concatenationvertcat

Hello everyone,i'm going through with this error.
problem : in this object classification system for training purpose, i'm using 10 folders in a train name folder in this folder 10 folders labelled as (0 to 9) that is ok with the system but when i'm using 11 or 12 folders then it will generate a error. that is given bellow so here i just want to know how can i process all the folders and label all the folders.
plz help me
thank you..!!
Error using vertcat Dimensions of matrices being concatenated are not consistent.
Error in Offlinehindicharacter_classification (line 103) trainingLabels = [trainingLabels; labels];

Best Answer

Instead of initializing
trainingLabels = [];
instead use
trainingLabels = {};
Then, after your loop that creates all of the labels, use
trainingLabels = char(trainingLabels);