Main Content

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

getoptions

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

説明

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

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

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

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

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

p = getoptions(h) はプロット ハンドル h に関連したプロット オプション ハンドルを返します。p には、与えられた応答プロットで設定可能なすべてのオプションが含まれています。

p = getoptions(h,propertyName) は、ハンドル h をもつプロットの指定のオプション プロパティ、propertyName を返します。これを使用してプロット ハンドルを照会することができます。

すべて折りたたむ

この例では、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 は、極-零点プロットまたは I/O 極-零点プロットの mpzplot オブジェクトです。

特定のプロパティ名。string または文字ベクトルとして指定します。各プロット タイプに使用可能なプロパティと値の一覧は、プロパティと値のリファレンスを参照してください。

出力引数

すべて折りたたむ

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

バージョン履歴

R2006a より前に導入