Skip to Main Content Skip to Search
Product Documentation

setoptions - Set plot options for response plot

Syntax

setoptions(h, PlotOpts)
setoptions(h, 'Property1', 'value1', ...)
setoptions(h, PlotOpts, 'Property1', 'value1', ...)

Description

setoptions(h, PlotOpts) sets preferences for response plot using the plot handle. h is the plot handle, PlotOpts is a plot options handle containing information about plot options.

There are two ways to create a plot options handle:

setoptions(h, 'Property1', 'value1', ...) assigns values to property pairs instead of using PlotOpts. To find out what properties and values are available for a particular plot, type help <function>options. For example, for Bode plots type

help bodeoptions

For a list of the properties and values available for each plot type, see Properties and Values Reference.

setoptions(h, PlotOpts, 'Property1', 'value1', ...) first assigns plot properties as defined in @PlotOptions, and then overrides any properties governed by the specified property/value pairs.

Examples

To change frequency units, first create a Bode plot.

sys=tf(1,[1 1]);
h=bodeplot(sys)     % Create a Bode plot with plot handle h.

Now, change the frequency units from rad/s to Hz.

p=getoptions(h);    % Create a plot options handle p.
p.FreqUnits = 'Hz'; % Modify frequency units.
setoptions(h,p);    % Apply plot options to the Bode plot and 
                    % render.

To change the frequency units using property/value pairs, use this code.

sys=tf(1,[1 1]);
h=bodeplot(sys);
setoptions(h,'FreqUnits','Hz');

The result is the same as the first example.

See Also

getoptions

  


Free Control Systems Interactive Kit

Learn more about resources for designing, testing, and implementing control systems.

Get free kit

Trials Available

Try the latest control systems products.

Get trial software
 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS