{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Mat loads from a le named func title and labels you

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: add a title and labels for the axes with the commands title, xlabel, ylabel and zlabel. You can also add contour labels to a contour plot by the command clabel. Other text can be added to the graph by using the text or gtext commands. With text, you specify a location where left edge of a text string is placed. With gtext, you position the text string with the mouse. Here is an example which adds titles and labels to the graph of f (x) = sin(x). Example 4: Plot y = sin(x) 0 x 2 , with appropriate labels. x = 0: 0.1: 2*pi plot(x,sin(x)) title('Y = Sin(X)') xlabel('X') ylabel('Y') hold plot(pi,0,'*') text(pi + 0.1, 0, 'Critical point') hold % or gtext('Critical point') Other Interesting Features of Matlab Plotting Matlab has a lot more capability for graphing or plotting than what has been mentioned here. What follows is a very brief description of three options (multiple graphs in one window, changing the viewpoint for 3-D plots, and controlling axes). Matlab also o ers ways to turn a sequence of graphs into a movie, control almost every aspect of graphics objects , and create image plots. You 6 should read the Matlab User's Guide (or some other commercial documentation) for more information. Multiple Plots The command subplot(m,n,p) breaks the graph (or gure) window into an m-by-n matrix of small rectangular panes. The value of p is the pane for the next plot. Panes are numbered from left to right, top to bottom. To return to the default single graph per window, use either subplot(1,1,1) or clf . You can have more than one graphics window on an X display. The Matlab command, gure opens a new window, numbering each new window. You can then use commands such as clf, gure(h), or close to manipulate the gure windows. Viewpoint You can set the angle of view of a 3-D plot with th...
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online