[Simulink] How to find different Sample Time blocks
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
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 comentarios
Respuestas (1)
Orion
el 12 de Nov. de 2014
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 comentarios
Ver también
Categorías
Más información sobre Legend en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!