ヘルプ センターヘルプ センター
Simulink.defineIntEnumType で定義されている列挙クラスを検索
Simulink.defineIntEnumType
R2018b 以降
result = Simulink.findIntEnumType(typeName)
result = Simulink.findIntEnumType()
例
result = Simulink.findIntEnumType(typeName) は、Simulink.defineIntEnumType で定義されているクラス type の meta.class オブジェクトを返します。返された meta.class オブジェクトを使用して、列挙クラスの属性をクエリします。クラスが存在しない場合、関数は空の meta.class オブジェクトを返します。
result
typeName
type
meta.class
result = Simulink.findIntEnumType() は、Simulink.defineIntEnumType で定義されたすべての列挙クラスの meta.class オブジェクトを返します。返された meta.class オブジェクトを使用して、列挙クラスの属性をクエリします。
すべて折りたたむ
列挙型を定義します。
Simulink.defineIntEnumType('myEnumType', {'e1', 'e2'}, [1 2]);
作成した列挙型を確認します。
myResult = Simulink.findIntEnumType('myEnumType')
myResult = class with properties: Name: 'myEnumType' Description: '' DetailedDescription: '' Hidden: 0 Sealed: 0 Abstract: 0 Enumeration: 1 ConstructOnLoad: 0 HandleCompatible: 0 InferiorClasses: {[1×1 meta.class]} ContainingPackage: [0×0 meta.package] RestrictsSubclassing: 0 PropertyList: [0×1 meta.property] MethodList: [150×1 meta.method] EventList: [0×1 meta.event] EnumerationMemberList: [2×1 meta.EnumeratedValue] SuperclassList: [1×1 meta.class]
2 つの列挙型を定義します。
Simulink.defineIntEnumType('myEnumType1', {'e1', 'e2'}, [1 2]); Simulink.defineIntEnumType('myEnumType2', {'e3', 'e4'}, [3 4]);
myResult = Simulink.findIntEnumType()
Simulink.defineIntEnumType で定義されている特定の列挙クラスの名前。文字ベクトルまたは string として指定します。
例: 'myEnumType'
'myEnumType'
データ型: char | string
char
string
検索結果。meta.class オブジェクトの配列として返されます。列挙型のクラスがない場合、配列は空になります。
R2018b で導入
enumeration | Simulink.clearIntEnumType | Simulink.defineIntEnumType
enumeration
Simulink.clearIntEnumType
次の MATLAB コマンドに対応するリンクがクリックされました。
コマンドを MATLAB コマンド ウィンドウに入力して実行してください。Web ブラウザーは MATLAB コマンドをサポートしていません。
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:
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Contact your local office