このページの内容は最新ではありません。最新版の英語を参照するには、ここをクリックします。
getReferencedModelNames
クラス: coder.codedescriptor.CodeDescriptor
名前空間: coder.codedescriptor
参照モデルの名前を返す
構文
refModels = getReferencedModelNames(codeDescObj)
説明
は、refModels
= getReferencedModelNames(codeDescObj
)coder.codedescriptor.CodeDescriptor
オブジェクトの参照モデルのリストを返します。このリストには、CodeDescriptor
オブジェクトが直接参照するモデルのみが含まれます。たとえば、model1
が model2
を参照し、model2
が model3
を参照している場合、model1
CodeDescriptor
オブジェクトから getReferencedModelNames
を実行すると model2
のみが返され、model3
は返されません。
入力引数
出力引数
例
モデルに含まれる参照モデルの名前の取得
1. モデル AsynchronousEventsTop
を開きます。
open_system('AsynchronousEventsTop');
2. モデルを作成します。
slbuild('AsynchronousEventsTop')
### Starting serial model reference code generation build.
Warning: Simulink Coder: The tornado.tlc target will be removed in a future release.
### Successfully updated the model reference code generation target for: AsynchronousEventsRef ### Starting build procedure for: AsynchronousEventsTop
Warning: Simulink Coder: The tornado.tlc target will be removed in a future release.
### Successful completion of code generation for: AsynchronousEventsTop Build Summary Code generation targets built: Model Action Rebuild Reason ================================================================================= AsynchronousEventsRef Code generated. AsynchronousEventsRef.c does not exist. Top model targets built: Model Action Rebuild Reason ========================================================================================== AsynchronousEventsTop Code generated. Code generation information file does not exist. 2 of 2 models built (0 models already up to date) Build duration: 0h 0m 30.953s
3. モデルの coder.codedescriptor.CodeDescriptor
オブジェクトを作成します。
codeDescObj = coder.getCodeDescriptor('AsynchronousEventsTop')
codeDescObj = CodeDescriptor with properties: ModelName: 'AsynchronousEventsTop' BuildDir: '/tmp/Bdoc23b_2369753_792668/tpf0c74606/simulinkcoder-ex95496067/AsynchronousEventsTop_tornado_rtw'
4. モデルに含まれる参照モデルのリストを取得します。
refModels = getReferencedModelNames(codeDescObj); refModels
refModels = 1x1 cell array
{'AsynchronousEventsRef'}
{'AsynchronousEventsRef'}
バージョン履歴
R2018a で導入