You can use the num2str
function to convert the number to a string, and then concatenate it with the cell value using square brackets. Here's an example:
main.m170 chars9 lines
This will output:
main.m9 chars2 lines
Note that the curly braces ({}
) in the indexing of mycell
are used to access the contents of the cell. Without them, you would get a cell array of 1x1 with the original cell inside.
gistlibby LogSnag