Getting Started Previous page   Next Page

Modifying the Graph Data Source

You can link graph data to variables in your workspace. When you change the values contained in the variables, you can then update the graph to use the new data without having to create a new graph. (See also the refresh function.)

Suppose you have the following data:

Using the plotting tools, create a graph of y = sin(x):

New Values for the Data Source

The data that defines the graph is linked to the x and y variables in the base workspace. If you assign new values to these variables and click the Refresh Data button, MATLAB updates the graph to use the new data:


Previous page  Examples -- Using MATLAB Plotting Tools Preparing Graphs for Presentation Next page

© 1994-2005 The MathWorks, Inc.