You are passing in a variable called title to the second function. This will hide the function of the same name so that this instruction:
title(dataset.subtitle(i));
is no longer calling the title function, but is instead trying to index into your variable called title using dataset.subtitle(i) as an index.
Rename your variable to something else and it should be fine.
Always try to remember never to use function names as variable names!!
1 Comment
Sulaymon Eshkabilov (view profile)
Direct link to this comment
https://au.mathworks.com/matlabcentral/answers/488718-unable-to-use-a-value-of-type-cell-as-an-index#comment_762573
Sign in to comment.