Main Content

fixed.DataGenerator

値セットの作成とデータの生成

R2019b 以降

説明

fixed.DataSpecification オブジェクトと fixed.DataGenerator オブジェクトを使用して、設計の動作範囲全体をテストするシミュレーション入力を生成します。

作成

説明

data = fixed.DataGenerator(Name, Value)Name, Value のペアの引数として指定された追加のプロパティで DataGenerator オブジェクトを作成します。

プロパティ

すべて展開する

生成するデータのプロパティ。fixed.DataSpecification オブジェクトとして指定します。

DataSpecification オブジェクトの cell 配列を指定すると、その cell 配列内の要素と同じ入力数および同じ順序で、システムへの入力用に単一の DataGenerator オブジェクトが生成されます。

生成されたデータにおけるデータ点の最大数。整数値スカラーとして指定します。詳細については、getNumDataPointsInfo を参照してください。

データ型: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64

オブジェクト関数

getUniqueValuesfixed.DataGenerator オブジェクトからの一意の値の取得
getNumDataPointsInfo生成されたデータのデータ点の数に関する情報の取得
outputAllDatafixed.DataGenerator オブジェクトからのデータの取得

すべて折りたたむ

コンストラクターで DataSpecification オブジェクトを指定して、DataGenerator オブジェクトを作成します。

-2π から 2π までの区間で、single のデータ型をもつ DataSpecification オブジェクトを作成します。

dataspec = fixed.DataSpecification('single',...
    'Intervals',{-2*pi, 2*pi})
dataspec = 
  fixed.DataSpecification with properties:

          DataTypeStr: 'single'
            Intervals: [-6.2832,6.2832]
     ExcludeDenormals: false
  ExcludeNegativeZero: false
      MandatoryValues: <empty>
           Complexity: 'real'
           Dimensions: 1

DataSpecification オブジェクトを使用して DataGenerator オブジェクトを作成します。生成されたデータのデータ点の数を 5000 点に制限します。これらのプロパティを名前と値のペアとして DataGenerator オブジェクトのコンストラクターで指定できます。

datagen = fixed.DataGenerator('DataSpecifications',dataspec,...
    'NumDataPointsLimit',5000)
datagen = 
  fixed.DataGenerator with properties:

    DataSpecifications: {[1x1 fixed.DataSpecification]}
    NumDataPointsLimit: 5000

関数 outputAllData を使用して生成されたデータを表示します。

myData = outputAllData(datagen);

アルゴリズム

すべて展開する

バージョン履歴

R2019b で導入

参考

オブジェクト