fixed.DataSpecification
説明
fixed.DataSpecification
オブジェクトと fixed.DataGenerator
オブジェクトを使用して、設計の動作範囲全体をテストするシミュレーション入力を生成します。
作成
構文
説明
は、既定のプロパティ値と dataspec
= fixed.DataSpecification(numerictype
)numerictype
で指定されたデータ型で DataSpecification
オブジェクトを作成します。
は、dataspec
= fixed.DataSpecification(numerictype
,Name,Value
)numerictype
で指定されたデータ型と、Name,Value
のペアの引数として指定された追加のプロパティで、DataSpecification
オブジェクトを作成します。
入力引数
numerictype
— 生成されたデータのデータ型
文字ベクトル | Simulink.NumericType
オブジェクト | embedded.numerictype
オブジェクト
生成されるデータのデータ型。数値データ型として評価される string または文字ベクトルか、Simulink.NumericType
オブジェクトまたは numerictype
オブジェクトとして指定します。
例: dataspec = fixed.DataSpecification('double')
例: dataspec = fixed.DataSpecification('fixdt(1,16,4)')
例: dataspec = fixed.DataSpecification(Simulink.NumericType);
プロパティ
DataTypeStr
— 生成されたデータのデータ型
文字ベクトル | Simulink.NumericType
オブジェクト | embedded.numerictype
オブジェクト
生成されるデータのデータ型。数値データ型として評価される string または文字ベクトルか、Simulink.NumericType
オブジェクトまたは numerictype
オブジェクトとして指定します。
このプロパティは作成後に編集できません。
Intervals
— 数値データを生成する区間
fixed.Interval
オブジェクト | fixed.Interval
オブジェクトの配列 | fixed.Interval
コンストラクターへの入力が含まれる cell 配列
数値データを生成する数値区間。fixed.Interval
オブジェクト、fixed.Interval
オブジェクトの配列、または fixed.Interval
コンストラクターへの入力が含まれる cell 配列として指定します。
区間を指定しない場合、既定の区間は、指定された数値型の表現可能な最小値と最大値に等しい端点を使用します。
例: dataspec.Intervals = {-1,1};
例: dataspec.Intervals = fixed.Interval(-1,1);
ExcludeDenormals
— 生成されたデータから非正規数を除外するかどうか
false (既定値) | true
生成されたデータから非正規数を除外するかどうか。logical として指定します。
このプロパティは DataTypeStr
プロパティが浮動小数点型の場合にのみ適用されます。
データ型: logical
ExcludeNegativeZero
— 生成されたデータから負のゼロを除外するかどうか
false (既定値) | true
生成されたデータから負のゼロを除外するかどうか。logical として指定します。
このプロパティは DataTypeStr
プロパティが浮動小数点型の場合にのみ適用されます。
データ型: logical
MandatoryValues
— 生成されたデータに含める値
<empty>
(既定値) | スカラー | ベクトル | 行列 | 多次元配列
生成されたデータに含める値。スカラー、ベクトル、行列または多次元配列として指定します。MandatoryValues
で指定した値が DataTypeStr
で指定したデータ型の範囲外である場合、値は最も近い表現可能な値に飽和されます。
例: dataspec.MandatoryValues = [-215, 216];
データ型: single
| double
| int8
| int16
| int32
| int64
| uint8
| uint16
| uint32
| uint64
| logical
| fi
Complexity
— 生成されたデータの実数/複素数
'real'
(既定値) | 'complex'
生成されたデータの実数/複素数。'real'
または 'complex'
として指定します。
例: dataspec.Complexity = 'complex';
データ型: char
| string
Dimensions
— 生成されたデータの次元
1 (既定値) | 正のスカラー整数 | 正の整数の行ベクトル
生成されたデータの次元。正のスカラー整数または正の整数の行ベクトルとして指定します。
例: dataspec.Dimensions = 3;
データ型: single
| double
| int8
| int16
| int32
| int64
| uint8
| uint16
| uint32
| uint64
オブジェクト関数
contains | 指定した値が DataSpecification オブジェクトの値の領域に含まれているかどうかの判別 |
applyOnRootInport | (削除予定) Inport ブロックへのプロパティの適用 |
例
fixed.DataSpecification
オブジェクトの作成
fixed.DataSpecification
オブジェクトを既定のプロパティ値と int16 データ型で作成します。
dataspec = fixed.DataSpecification('int16')
dataspec = fixed.DataSpecification with properties: DataTypeStr: 'int16' Intervals: [-32768,32767] MandatoryValues: <empty> Complexity: 'real' Dimensions: 1
DataSpecification
オブジェクトの既定の区間は、コンストラクターで指定されたデータ型の範囲と同等です。
fixed.DataSpecification
オブジェクトからの fixed.Interval
オブジェクトの作成
- から の範囲を指定する fixed.Interval
オブジェクトを作成します。
interval = fixed.Interval(-pi,pi)
interval = [-3.1416,3.1416] 1x1 fixed.Interval with properties: LeftEnd: -3.1416 RightEnd: 3.1416 IsLeftClosed: true IsRightClosed: true
この区間と fixdt(1,16,10)
のデータ型を使用して DataSpecification
オブジェクトを作成します。
dataspec = fixed.DataSpecification('fixdt(1,16,10)',... 'Intervals',interval)
dataspec = fixed.DataSpecification with properties: DataTypeStr: 'sfix16_En10' Intervals: [-3.1416,3.1416] MandatoryValues: <empty> Complexity: 'real' Dimensions: 1
または、fixed.Interval
コンストラクターへの入力の cell 配列として区間を指定できます。次のコードは等価の DataSpecification
オブジェクトを生成します。
dataspec = fixed.DataSpecification('fixdt(1,16,10)',... 'Intervals',{-pi,pi})
dataspec = fixed.DataSpecification with properties: DataTypeStr: 'sfix16_En10' Intervals: [-3.1416,3.1416] MandatoryValues: <empty> Complexity: 'real' Dimensions: 1
NaN と Inf が含まれる DataSpecification
オブジェクトの作成
NaN 値と Inf 値を Interval
オブジェクトの区間として指定することで、生成されたデータにこれらの値を含めることができます。
次のコードは、値 -Inf、Inf、NaN と範囲 [-1, 1] が含まれる Interval オブジェクトの配列を参照する DataSpecification
オブジェクトを作成します。
dataspec = fixed.DataSpecification('single', 'Intervals',... {{-Inf}, {Inf}, {NaN}, {-1,1}})
dataspec = fixed.DataSpecification with properties: DataTypeStr: 'single' Intervals: [-Inf] [-1,1] [Inf] [NaN] ExcludeDenormals: false ExcludeNegativeZero: false MandatoryValues: <empty> Complexity: 'real' Dimensions: 1
バージョン履歴
R2019b で導入
MATLAB コマンド
次の MATLAB コマンドに対応するリンクがクリックされました。
コマンドを MATLAB コマンド ウィンドウに入力して実行してください。Web ブラウザーは MATLAB コマンドをサポートしていません。
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)