モデル内に含まれるMatlab Function ブロックの一覧を検出する方法はありますか?

モデル内に含まれるMatlab Function ブロックの一覧を検出する方法を教えてください。

 Réponse acceptée

MathWorks Support Team
MathWorks Support Team le 25 Juil 2023
Modifié(e) : MathWorks Support Team le 25 Juil 2023

0 votes

Stateflow.EMChart オブジェクトを使用して、検出できます。
​
%モデルを開く
%以下でMATLAB Function ブロックパスを検出
​bd = get_param(gcs,'Object');
blks = find(bd,'-isa','Stateflow.EMChart');
for n=1:length(blks)
blks(n).Path
end
​%
​
関連ドキュメントページ
​プログラムによる MATLAB Function ブロックの設定
https://jp.mathworks.com/help/simulink/ug/configure-matlab-function-blocks-programmatically.html
​

Plus de réponses (1)

0 votes

SubSystemのブロックパラメーターSFBlockTypeをfind_systemで検索することで、MATLAB Functionを検出できます。
find_system(bdroot, 'SFBlockType', 'MATLAB Function')
同様の方法で、下記Stateflowブロックも特定することができます。ブロック名とSFBlockTypeの値を記述します。
ブロック名 : SFBlockType
  • Chart : Chart
  • Truth Table : Truth Table
  • State Transition Table : State Transition Table
  • MATLAB Function : MATLAB Function

Catégories

En savoir plus sur モデル化 dans Centre d'aide et File Exchange

Produits

Tags

Aucun tag saisi pour le moment.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!