MATLAB: How to predict labels of an image using classificationECOC classifier

classificationcomputer visionComputer Vision ToolboxstatisticsStatistics and Machine Learning Toolbox

I followed digit classification examples using hog features. At, last I successfully created a classifier. Now, I want to predict the labels of a single image. So, I tried:
imgTest = imread('imageThree-0279.png');
lvl = graythresh(imgTest);
imgTest = im2bw(imgTest, lvl);
testFeatures = extractHOGFeatures(imgTest,'Cellsize', cellSize);
%%Make class predictions using the test features.
[lblIdx,scores] = predict(classifier, testFeatures);
classifier.Labels(lblIdx);
But, I got error: Error using subsref No appropriate method, property, or field 'Labels' for class 'ClassificationECOC'.
Soon, I realized that 'ClassificationECOC' doesn't contain any field 'Labels'. So then, what should I used. I can see that 'lblIdx' holds ans '3' in workspace. But, how can i display the labels? Any help would be appreciated.

Best Answer

Index your cell array of strings that are your labels, at locations indicated by lblIdx
MyLabels(lblIdx)