how to acces blocks using iteration variable

2 次查看(过去 30 天)
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')

采纳的回答

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

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Troubleshooting 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by