how to acces blocks using iteration variable

3 views (last 30 days)
how to change this code in single line using for loop..
set_param('system/sub1','Commented','OFF') set_param('system/sub2','Commented','OFF') set_param('system/sub3','Commented','OFF') set_param('system/sub4','Commented','OFF') set_param('system/sub5','Commented','OFF') set_param('system/sub6','Commented','OFF')

Accepted Answer

Orion
Orion on 12 Dec 2014
for i = 1:6
set_param(['system/sub' num2str(i)],'Commented','OFF');
end

More Answers (0)

Categories

Find more on General Applications in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!