how to change name of simulink blocks through matlab code

조회 수: 7(최근 30일)
exl = actxserver('excel.application');
exlWkbk = exl.workbooks.Add;
new1= readtable('names.xlsx');
list_of_block_in_subsystem = find_system('Auto_Script','type', 'block');
for i = 1:length(list_of_block_in_subsystem)
old_name = get_param(list_of_block_in_subsystem{i},'Name');
new_name = new1.aa{i};
set_param(list_of_block_in_subsystem{i}, 'Name', new_name);
end
%code is not running completely only half of the names changes and also code is executing only ones.

답변(0개)

태그

Community Treasure Hunt

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

Start Hunting!

Translated by