Debangshu - according to insertText text input argument, your value should be a text character vector or cell array of text character vectors. I think that the MATLAB example is incorrect and that they are missing a step to convert this to a cell array of strings like
text_str = {'555', num2str(pi)};
or
text_str = cell(1,length(value));
for k=1:length(value)
text_str{k} = num2str(value(k));
end
RGB = insertText(I,position, text_str,'AnchorPoint','LeftBottom');
This is similar to what they did in a previous example (converting the numeric array to a cell string array).
