Azzera filtri
Azzera filtri

Setting default values for bodeoptions

13 visualizzazioni (ultimi 30 giorni)
Balazs Fischer
Balazs Fischer il 16 Dic 2020
Risposto: mitchell scott il 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.)

Risposte (2)

Star Strider
Star Strider il 16 Dic 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 Commento
Balazs Fischer
Balazs Fischer il 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.

Accedi per commentare.


mitchell scott
mitchell scott il 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).

Categorie

Scopri di più su Get Started with Control System Toolbox in Help Center e File Exchange

Prodotti


Release

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by