MATLAB: Print OCR results to text file

ocr

Hello,
I have read the other posts and examples for printing your OCR results into a text file but am running into an error.
Error using fprintf
Function is not defined for 'cell' inputs.
Error in REMOVEDallEXTRAbits (line 142)
fprintf(fileID, '%s\r\n', text);
ocrtxt = ocr(BW2, textBBoxes, 'Language', 'C:\Users\e362609\Documents\MATLAB\Examples\vision\TextDetectionExample\try50\tessdata\try50.traineddata');
% [ocrtxt.Text];
fileID = fopen('trytext.txt');
fprintf(fileID, '%s\r\n', text);
fclose(fileID);
Any help is much apreciated!

Best Answer

THE GOLDEN TICKET!!!!
THANK YOU ALL FOR ALL OF YOUR HELP :)
ocrtxt = ocr(BW2, textBBoxes, 'Language', 'C:\Users\e362609\Documents\MATLAB\Examples\vision\TextDetectionExample\try50\tessdata\try50.traineddata');
% ocrtxt(1,1).Text
f = fopen('C:\Users\e362609\Documents\MATLAB\Examples\vision\TextDetectionExample\trytext.txt', 'w+');
for i= 1 :numel(ocrtxt)
fprintf(f,'%s\r\n',ocrtxt(i).Text);
end
% fclose('all');