how to change name of simulink blocks through matlab code

조회 수: 8 (최근 30일)
Vibhu Mehta
Vibhu Mehta . 2021년 12월 13일
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);
%code is not running completely only half of the names changes and also code is executing only ones.

답변 (0개)


Help CenterFile Exchange에서 Simulink Functions에 대해 자세히 알아보기


Community Treasure Hunt

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

Start Hunting!

Translated by