Is there a simple way to change sampling rate of multiple blocks in Simulink?
Show older comments
Dear Experts,
Just wondering if there is a simple way to change sampling rate of multiple blocks?
Or if there is a programmatic way of list out all blocks inside a model, and use list assignment to change sampling rate?
Please comment,
Thanks,
Accepted Answer
More Answers (1)
Azzi Abdelmalek
on 24 Feb 2014
ts=0.0001 % your sample time
s=find_system('untitled')
for k=2:numel(s)
m=s{k}
try
b=get_param(m,'sample time');
set_param(m,'sample time',num2str(ts))
catch
end
end
Categories
Find more on Programmatic Model Editing in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!