Main Content

Simulink.SampleTime クラス

名前空間: Simulink
スーパークラス:

サンプル時間の情報を含むオブジェクト

説明

SampleTime クラスは、個々のサンプル時間に関連したサンプル時間情報を表します。

Simulink.Block.getSampleTimesSimulink.BlockDiagram.getSampleTimes のメソッドを使用して、ブロックおよびブロック線図の SampleTime プロパティの値をそれぞれ取得します。

プロパティ

Value

サンプル時間の期間とオフセットを含む double の 2 要素配列。

Description

1 行 n 列の文字配列。サンプル時間のタイプを記述します。

ColorRGBValue

サンプル時間の色の値 (RGB: 赤、緑、青) を含む double の 1 行 3 列の配列。

Annotation

1 行 n 列の文字配列。特定のサンプル時間の注釈 ('D1' など) を表します。

OwnerBlock

非同期と可変のサンプル時間用の OwnerBlock は、サンプル時間を制御するブロックへの絶対パスを含む文字ベクトルです。他のタイプのサンプル時間では空の文字ベクトルになります。

ComponentSampleTimes

サンプル時間が非同期の和集合またはハイブリッドでサンプル時間のコンポーネントが使用可能な場合、ComponentSampleTimes 配列には Simulink.SampleTime オブジェクトが含まれます。

コピーのセマンティクス

値。値クラスがコピー操作に与える影響については、『MATLAB® プログラミングの基礎』ドキュメンテーションのオブジェクトのコピーを参照してください。

'vdp' モデルのサンプル時間情報を取得します。

ts = Simulink.BlockDiagram.getSampleTimes('vdp')

Simulink では以下が返されます。

ts = 

  1x2 Simulink.SampleTime
  Package: Simulink

  Properties:
    Value
    Description
    ColorRGBValue
    Annotation
    OwnerBlock
    ComponentSampleTimes

  Methods

プロパティの値を調べるには、以下のようにします。

ts(1), ts(2)

ans = 

  Simulink.SampleTime
  Package: Simulink

  Properties:
                   Value: [0 0]
             Description: 'Continuous'
           ColorRGBValue: [0 0 0]
              Annotation: 'Cont'
              OwnerBlock: []
    ComponentSampleTimes: {}

  Methods


ans = 

  Simulink.SampleTime
  Package: Simulink

  Properties:
                   Value: [Inf 0]
             Description: 'Constant'
           ColorRGBValue: [1 0.2600 0.8200]
              Annotation: 'Inf'
              OwnerBlock: []
    ComponentSampleTimes: {}

  Methods