How do I query the data type of every input and output port in a Simulink model?
13 ビュー (過去 30 日間)
古いコメントを表示
When I select Port data types from the Format menu of a Simulink model, I can see the data type of every input and output port in this model. I would like to query these data types from command line or a script, and I also want to be able to do this using a generic model name such as gcs.
採用された回答
MathWorks Support Team
2010 年 6 月 16 日
Note that in order to query the data type, you need to compile the model first. Try the following example:
vdp
% open the model
vdp([],[],[],'compile');
% compile the model
h = get_param('vdp/Mu','Porthandles');
% get the port handles
get_param(h.Outport,'CompiledPortDataType')
% get the output port data type
vdp([],[],[],'term')
% terminate the compilation
For a generic model name such as 'gcs', consider using the EVAL function. Here is an example:
vdp
eval([gcs,'([],[],[],''compile'');'])
h = get_param('vdp/Mu','Porthandles');
get_param(h.Outport,'CompiledPortDataType')
eval([gcs,'([],[],[],''term'')'])
0 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Model, Block, and Port Callbacks についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!