MATLAB: Index exceeds matrix dimensions

plot

I have a file that plots results from a simulation. Ive been using it for a long time and now it has started giving me this problem:
Index exceeds matrix dimensions.
Error in Plot_Results (line 210)
title('Velocity of cycle')
The first time I run the file it works fine. But if I run it again without changing anything (and there is nothing to clear any variables in the code) it gives me that error. If I comment out every title, xlabel, and ylabel line then itll work fine and will plot the several plots I have in the file but with no titles or anything. This just started happening and I cant figure out why. The code was working just fine before this randomly started happening.
thanks

Best Answer

Alright I figured it out. For some reason it wasnt rewriting the title variable from an old run so i just added "clear title xlabel ylabel" and that seems to have fixed it.