how to generate dynamic titles for images in matlab