[Simulink] How to find different Sample Time blocks
6 ビュー (過去 30 日間)
古いコメントを表示
Hello
I am 2012b version user.
on simulink my model, There are two different sample time legens as below (checked using Display- Sample Time - All menu)
(Ammotation - Description - value
D1 - Discrete1 - 0.03
inf - Constant - inf)
My Model is set for discrete simulation. I'd like to find inf constant blocks to make it discrete. However, I checked almost block's sample time setteing manually, but I couldn't find the block which has inf configuration. (All annotation of arrows shows D1- Discrete message)
so, I want to know how to find the block which has the different sample time automatically or manually
Thank you in advance.
0 件のコメント
回答 (1 件)
Orion
2014 年 11 月 12 日
Hi,
I guess you'd like something like
% get all constant block in the model
AllConstBlocks = find_system(bdroot,'BlockType','Constant');
% loop on all these block
for i = 1:length(AllConstBlocks)
% if the sample time is inf, then display the full path to the block
if strcmp(get_param(AllConstBlocks{i},'SampleTime'),'inf')
disp(AllConstBlocks{i});
end
end
you can adapt this for different kind of block, or other sample times.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Interactive Model Editing についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!