This example shows how to add a title, axis labels and a legend to a graph using the title, xlabel, ylabel and legend functions.
www.mathworks.com