Setting default values for bodeoptions

17 views (last 30 days)
Balazs Fischer
Balazs Fischer on 16 Dec 2020
Answered: mitchell scott on 21 Apr 2022
Hello,
I know I can override the default values for bode by using
P=bodeoptions;
P.whatever='foo';
bode(system,P);
But I don't want to add to every bode command the additional parameters and want others working with my skripts to be able to display the bode plots how they prefer them. How can I set the default value of bode options? I'm looking for a command like changing the default linewidth
set(groot,'defaultLineLineWidth',2)
but for bode plots (and step responses and nichols plots etc.)

Answers (2)

Star Strider
Star Strider on 16 Dec 2020
See if the setoptions function will do what you want.
Beyond that, I doubt there is a way to set the defaults. The closest it is likely possible to get is described in the bodeoptions documentation section on Create Bode Plot with Custom Settings and see if it will do what you want (assuming you are not already aware of it, although you did not mention having seen it or experimented with it in your Question).
  1 Comment
Balazs Fischer
Balazs Fischer on 3 Feb 2021
Thanks for the answer, I have looked at the documentation of setoptions and bodeoptions but it seems what I want is not possible. It is weird that Mathworks made it possible to set defaults for plots but not for specialised plots like bode.

Sign in to comment.


mitchell scott
mitchell scott on 21 Apr 2022
I was also wondering this same thing, I found out you can set the defaults in the Contol Systems toolbox and then call
opts = bodeopts('cstprefs')
bode(sys, opts)
This is not much better but I though it was cleaner than setting all the options I wanted. theres more info about this if you search Control Systems toolbox editor in the matlab Documentation search bar (upper right for me).

Categories

Find more on Get Started with Control System Toolbox in Help Center and File Exchange

Products


Release

R2020b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!