MATLAB: Using a text file to title a plot.

plottingtitle

I have a program that uses many different data sets to generate plots. In order to keep track of where each plot comes from I would like to pull the data set name out of an associated readme file. The trouble is that I can't seem to figure out how to insert the string I get from the readme. My code gets the string with a simple: label = textread(readme.txt, '%s'), but after getting the label I have not figured out how to successfully insert that label into my plot's title (printing label to the screen shows the desired output). Any suggestions?

Best Answer

Try
title([label char(10) 'x vs y']) % char(10) for newline