Use the Create Plot task in the Live Editor to interactively create and visualize different linear analysis plots. You can also use an options object from your MATLAB® workspace to customize your plot. Open this example to see a preconfigured script containing the Create Plot task to create a Bode plot.
For this example, consider the following SISO state-space model:
Create the SISO state-space model defined by the following state-space matrices:
To create a Bode plot of sys
, open the Create Plot task in the Live Editor. On the Live Editor tab, select Task > Create Plot. In the task, select Control Toolbox Plots
from the Filter by Category dropdown menu. You can also directly search for the plot type by typing in the plot name in the Select visualization field.
Next, select bodeplot from the available plots. If you do not have a supported model type in your MATLAB workspace, then the respective plot type will not be available.
Use the Dynamic System dropdown menu to pick the appropriate model from your MATLAB workspace. You can use the Frequencies dropdown menu to specify a vector of frequencies. You can also customize your plot by using a predefined options object. For more information, see bodeplot
.
For this example, pick sys
and leave the other options as default
.
You can also select the color, line style and marker symbol for the plot using the Select optional visualization parameters menu. You can click
to add more visualization parameters. For this example, change the line color to green.

To see the code that this task generates, expand the task display by clicking
Show code at the bottom of the task parameter area.
You can also overlay multiple visualizations on the same plot axis. For more information and examples, see the Create Plot task reference page.