drawmag
Purpose
Mouse-based tool for sketching and fitting
Syntax
Description
drawmag
interactively uses the mouse in the plot window to create pts (the frd object) and sysout (a stable minimum-phase ss object), which approximately fits the frequency response (magnitude) in pts.
Input arguments:
data
|
Either a frequency response object that is plotted as a reference, or a constant matrix of the form [xmin xmax ymin ymax] specifying the plot window on the data.
|
init_pts
|
Optional frd objects of initial set of points
|
Output arguments:
sysout
|
Stable, minimum-phase ss object that approximately fits, in magnitude, the pts data.
|
pts
|
Frequency response of points.
|
While drawmag is running, all interaction with the program is through the mouse and/or the keyboard. The mouse, if there is one, must be in the plot window. The program recognizes several commands:
- Clicking the mouse button adds a point at the cross-hairs. If the cross-hairs are outside the plotting window, the points are plotted when the fitting, windowing, or replotting mode is invoked. Typing a is the same as clicking the mouse button.
- Typing r removes the point with frequency nearest that of the cross-hairs.
- Typing any integer between 0 and 9 fits the existing points with a transfer function of that order. The fitting routine approximately minimizes the maximum error in a log sense. The new fit is displayed along with the points, and the most recent previous fit, if it exists.
- Typing w uses the cross-hair location as the initial point in creating a window. Moving the cross-hairs and clicking the mouse or pressing any key then gives a second point at the new cross-hair location. These two points define a new window on the data, which is immediately replotted. This is useful in fine tuning parts of the data. You can call windowing repeatedly.
- Typing p simply replots the data using a window that covers all the current data points as well as whatever was specified in in. Typically used after windowing to view all the data.
- Typing k invokes the keyboard using the keyboard command. You should exercise caution when using this option, as it can wreak havoc on the program if variables are changed.
See Also
ginput Graphically input information from mouse
loglog Plotting frequency responses on log-log scale
| | Provide feedback about this page |
 | dmplot | | evallmi |  |
Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.
Get the Interactive Kit