Main Content

このページの内容は最新ではありません。最新版の英語を参照するには、ここをクリックします。

setoptions

プロット オプション ハンドルまたはプロットのオプション プロパティを設定する

説明

setoptions を使用してプロット ハンドル オプションまたはプロパティ リストを設定し、それを使用して座標軸のラベル、座標軸の範囲、座標軸の単位の変更など、プロットをカスタマイズできます。各プロット タイプに使用可能なプロパティと値の一覧は、プロパティと値のリファレンス (Control System Toolbox)を参照してください。プロット ハンドルを使用して既存のプロットをカスタマイズするには、次のようにします。

  1. プロット ハンドルを取得

  2. getoptions を使用してオプション セットを取得

  3. setoptions を使用してプロットを更新し、必要なオプションを変更

詳細については、コマンド ラインからの応答プロットのカスタマイズ (Control System Toolbox)を参照してください。

setoptions(h,p) は、プロット ハンドル h とプロット オプションについての情報を格納したプロット オプション ハンドル p を使用して応答プロットの基本設定を設定します。

setoptions(h,'property1','value1',...,'propertyN','valueN') は、プロット オプション ハンドル p を使用する代わりに、値をプロパティと値のペアに割り当てます。各プロット タイプに使用可能なプロパティと値の一覧は、プロパティと値のリファレンス (Control System Toolbox)を参照してください。

setoptions(h,p,'property1','value1',...,'propertyN','valueN') は、最初にプロット オプション ハンドル p を使用してプロパティを割り当てます。次に、指定されたプロパティと値のペアで決まるプロパティをオーバーライドします。各プロット タイプに使用可能なプロパティと値の一覧は、プロパティと値のリファレンス (Control System Toolbox)を参照してください。

すべて折りたたむ

この例では、3 つの入力、3 つの出力および 3 つの状態をもつ MIMO 状態空間モデルについて考えます。赤のグリッド ラインをもつインパルス プロットを作成します。

MIMO 状態空間モデル sys_mimo を作成します。

J = [8 -3 -3; -3 8 -3; -3 -3 8];
F = 0.2*eye(3);
A = -J\F;
B = inv(J);
C = eye(3);
D = 0;
sys_mimo = ss(A,B,C,D);
size(sys_mimo)
State-space model with 3 outputs, 3 inputs, and 3 states.

プロット ハンドル h を使ってインパルス プロットを作成し、利用可能なオプションのリストに対して getoptions を使用します。

h = impulseplot(sys_mimo)

Figure contains 9 axes objects. Axes object 1 with title From: In(1), ylabel To: Out(1) contains an object of type line. This object represents sys\_mimo. Axes object 2 with ylabel To: Out(2) contains an object of type line. This object represents sys\_mimo. Axes object 3 with ylabel To: Out(3) contains an object of type line. This object represents sys\_mimo. Axes object 4 with title From: In(2) contains an object of type line. This object represents sys\_mimo. Axes object 5 contains an object of type line. This object represents sys\_mimo. Axes object 6 contains an object of type line. This object represents sys\_mimo. Axes object 7 with title From: In(3) contains an object of type line. This object represents sys\_mimo. Axes object 8 contains an object of type line. This object represents sys\_mimo. Axes object 9 contains an object of type line. This object represents sys\_mimo.

h =

	resppack.timeplot
p = getoptions(h)
p =

                   Normalize: 'off'
         SettleTimeThreshold: 0.0200
              RiseTimeLimits: [0.1000 0.9000]
                   TimeUnits: 'seconds'
    ConfidenceRegionNumberSD: 1
                  IOGrouping: 'none'
                 InputLabels: [1x1 struct]
                OutputLabels: [1x1 struct]
                InputVisible: {3x1 cell}
               OutputVisible: {3x1 cell}
                       Title: [1x1 struct]
                      XLabel: [1x1 struct]
                      YLabel: [1x1 struct]
                   TickLabel: [1x1 struct]
                        Grid: 'off'
                   GridColor: [0.1500 0.1500 0.1500]
                        XLim: {3x1 cell}
                        YLim: {3x1 cell}
                    XLimMode: {3x1 cell}
                    YLimMode: {3x1 cell}

setoptions を使用して必要なカスタマイズでプロットを更新します。

setoptions(h,'Grid','on','GridColor',[1 0 0]);

Figure contains 9 axes objects. Axes object 1 with title From: In(1), ylabel To: Out(1) contains an object of type line. This object represents sys\_mimo. Axes object 2 with ylabel To: Out(2) contains an object of type line. This object represents sys\_mimo. Axes object 3 with ylabel To: Out(3) contains an object of type line. This object represents sys\_mimo. Axes object 4 with title From: In(2) contains an object of type line. This object represents sys\_mimo. Axes object 5 contains an object of type line. This object represents sys\_mimo. Axes object 6 contains an object of type line. This object represents sys\_mimo. Axes object 7 with title From: In(3) contains an object of type line. This object represents sys\_mimo. Axes object 8 contains an object of type line. This object represents sys\_mimo. Axes object 9 contains an object of type line. This object represents sys\_mimo.

setoptions を呼び出すと、インパルス プロットは自動的に更新されます。MIMO モデルの場合、impulseplot はプロットのグリッドを生成し、各プロットは 1 組の I/O のインパルス応答を表示します。

この例では、3 つの入力、3 つの出力および 3 つの状態をもつ MIMO 状態空間モデルについて考えます。線形周波数スケールを使ってボード線図を作成し、周波数単位を Hz に指定して、グリッドをオンにします。

MIMO 状態空間モデル sys_mimo を作成します。

J = [8 -3 -3; -3 8 -3; -3 -3 8];
F = 0.2*eye(3);
A = -J\F;
B = inv(J);
C = eye(3);
D = 0;
sys_mimo = ss(A,B,C,D);
size(sys_mimo)
State-space model with 3 outputs, 3 inputs, and 3 states.

プロット ハンドル h を使ってボード線図を作成し、利用可能なオプションのリストに対して getoptions を使用します。

h = bodeplot(sys_mimo);
p = getoptions(h)
p =

                   FreqUnits: 'rad/s'
                   FreqScale: 'log'
                    MagUnits: 'dB'
                    MagScale: 'linear'
                  MagVisible: 'on'
             MagLowerLimMode: 'auto'
                  PhaseUnits: 'deg'
                PhaseVisible: 'on'
               PhaseWrapping: 'off'
               PhaseMatching: 'off'
           PhaseMatchingFreq: 0
    ConfidenceRegionNumberSD: 1
                 MagLowerLim: 0
          PhaseMatchingValue: 0
         PhaseWrappingBranch: -180
                  IOGrouping: 'none'
                 InputLabels: [1x1 struct]
                OutputLabels: [1x1 struct]
                InputVisible: {3x1 cell}
               OutputVisible: {3x1 cell}
                       Title: [1x1 struct]
                      XLabel: [1x1 struct]
                      YLabel: [1x1 struct]
                   TickLabel: [1x1 struct]
                        Grid: 'off'
                   GridColor: [0.1500 0.1500 0.1500]
                        XLim: {3x1 cell}
                        YLim: {6x1 cell}
                    XLimMode: {3x1 cell}
                    YLimMode: {6x1 cell}

setoptions を使用して必要なカスタマイズでプロットを更新します。

setoptions(h,'FreqScale','linear','FreqUnits','Hz','Grid','on');

Figure contains 18 axes objects. Axes object 1 with title From: In(1), ylabel To: Out(1) contains an object of type line. This object represents sys\_mimo. Axes object 2 with ylabel To: Out(1) contains an object of type line. This object represents sys\_mimo. Axes object 3 with ylabel To: Out(2) contains an object of type line. This object represents sys\_mimo. Axes object 4 with ylabel To: Out(2) contains an object of type line. This object represents sys\_mimo. Axes object 5 with ylabel To: Out(3) contains an object of type line. This object represents sys\_mimo. Axes object 6 with ylabel To: Out(3) contains an object of type line. This object represents sys\_mimo. Axes object 7 with title From: In(2) contains an object of type line. This object represents sys\_mimo. Axes object 8 contains an object of type line. This object represents sys\_mimo. Axes object 9 contains an object of type line. This object represents sys\_mimo. Axes object 10 contains an object of type line. This object represents sys\_mimo. Axes object 11 contains an object of type line. This object represents sys\_mimo. Axes object 12 contains an object of type line. This object represents sys\_mimo. Axes object 13 with title From: In(3) contains an object of type line. This object represents sys\_mimo. Axes object 14 contains an object of type line. This object represents sys\_mimo. Axes object 15 contains an object of type line. This object represents sys\_mimo. Axes object 16 contains an object of type line. This object represents sys\_mimo. Axes object 17 contains an object of type line. This object represents sys\_mimo. Axes object 18 contains an object of type line. This object represents sys\_mimo.

setoptions を呼び出すと、ボード線図は自動的に更新されます。MIMO モデルの場合、bodeplot はボード線図の配列を生成し、各プロットは 1 組の I/O の周波数応答を表示します。

次の連続時間の伝達関数を作成します。

H(s)=1s+1

sys = tf(1,[1 1]);

プロット ハンドル h を使ってボード線図を作成します。

h = bodeplot(sys);

Figure contains 2 axes objects. Axes object 1 with ylabel Magnitude (dB) contains an object of type line. This object represents sys. Axes object 2 with ylabel Phase (deg) contains an object of type line. This object represents sys.

プロット オプションのハンドル p を作成します。

p = getoptions(h);

プロットの周波数単位を Hz に変更します。

p.FreqUnits = 'Hz';

プロット オプションをボード線図に適用します。

setoptions(h,p);

Figure contains 2 axes objects. Axes object 1 with ylabel Magnitude (dB) contains an object of type line. This object represents sys. Axes object 2 with ylabel Phase (deg) contains an object of type line. This object represents sys.

あるいは、setoptions(h,'FreqUnits','Hz') を使用します。

入力引数

すべて折りたたむ

プロット ハンドル。プロット ハンドル オブジェクトとして指定します。たとえば、h は、極-零点プロットまたは I/O 極-零点プロットの mpzplot オブジェクトです。

プロット オプション ハンドル。プロット オプション ハンドル オブジェクトとして指定します。たとえば、p は、極-零点プロットまたは I/O 極-零点プロットの PZMapOptions オブジェクトです。

プロット オプション ハンドルを作成するには、2 つの方法があります。

  • 関数 getoptions を使用する。これは、プロット ハンドルを受け入れて、プロット オプション ハンドルを返す。

    p = getoptions(h)
    
  • 次のいずれかのコマンドを使用して、既定のプロット オプション ハンドルを作成する。

    • bodeoptions — ボード線図

    • hsvoptions (Control System Toolbox) - ハンケル特異値プロット

    • nicholsoptions (Control System Toolbox) — ニコルス線図

    • nyquistoptions (Control System Toolbox) — ナイキスト線図

    • pzoptions — 極-零点プロット

    • sigmaoptions (Control System Toolbox) - シグマ プロット

    • timeoptions — 時間対応プロット (ステップ、初期、インパルスなど)

    以下に例を示します。

    p = bodeoptions
    

    ボード線図に対するプロット オプション ハンドルが返されます。

バージョン履歴

R2012a で導入