Graphics |
Generating an M-File to Recreate a Graph
You can generate an M-file from a graph, which you can then use to regenerate the graph. This approach is a useful way to generate M-code for work you have performed with the plotting tools. To use this option,
Running the Saved M-File
Most of the generated M-files require you to pass in data as arguments. The M-file assumes you are using the same data originally used to create the graph.
Comments at the beginning of the M-file state the type of data expected. For example, the following statements illustrate a case where three input vectors are required.
function createplot(X1, Y1, Y2) %CREATEPLOT(X1,Y1,Y2) % X1: vector of x data % Y1: vector of y data % Y2: vector of y data
See Example -- Generating M-Code to Reproduce a Graph for another example.
Printing Figures | Data Exploration Tools |
© 1994-2005 The MathWorks, Inc.