If you are working in an M-file when you request a plot, and then you continue with more computations, MATLAB ® will generate and display the graphics window and then return immediately to execute the rest of the commands in the program. If you request a second plot, the graph you created will be overwritten. There are two possible solutions to this problem: Use the pause command to temporarily halt the
execution of your M-file program so that you can examine the fi gure, or create a second figure, using the figure function. The pause command stops the program execution until any key is pressed. If you want to pause for a specified number of seconds, use the pause(n) command, which will cause execution to pause for n seconds before continuing.
The figure command allows you to open a new figure window. The next time you request a plot, it will be displayed in this new window. For example, figure(2)opens a window named “Figure 2,” which then becomes the window used for subse-quent plotting. Executing figure without an input parameter causes a new window to open, numbered consecutively one up from the current window. For example, if the current figure window is named “Figure 2,” executing figure will cause “Figure 3” to open. The commands used to create a simple plot are summarized in Table 5.1 .
Good engineering practice requires that we include axis labels and a title in our plot. The following commands add a title, x – and y -axis labels, and a background grid:
These commands generate the plot in Figure 5.2 . As with any MATLAB ®com-mands, they could also be combined onto one or two lines, separated by commas:
plot(x,y) , title(‘Laboratory Experiment 1’)
xlabel(‘Time, sec’ ), ylabel(‘Distance, ft’), grid
Once vectors of x -values and y -values have been defi ned, MATLAB makes it easy to create plots. Suppose a set of time versus distance data were obtained through measurement.
We can store the time values in a vector called x (the user can define any con-venient name) and the distance values in a vector called y :
x = [0:2:18];
y = [0, 0.33, 4.13, 6.29, 6.85, 11.19, 13.19, 13.96, 16.33,
To plot these points, use the plot command, with x and y as arguments:
A graphics window automatically opens, which MATLAB calls Figure 1. The resulting plot is shown in Figure 5.1 . (Slight variations in scaling of the plot may occur, depending on the size of the graphics window.)
What is Ubuntu One?
Ubuntu One is the personal cloud that brings your digital life together, so you can enjoy your content, your way, wherever you are. With our suite of cloud services including storage, sync, sharing and streaming – you have immediate access to your music collection, favorite photos, videos, important documents and more, at any time and from any device.
Ubuntu One is easy to install and easy to use – everyone gets our sync services and 5 GB of storage for free, and if you pay a little extra, you can add Music Streaming and Storage to suit your own needs.
For 5 GB Free Stored check the following link: