필터 지우기
필터 지우기

Matlab command for Simulink Goto 'rename all' button?

조회 수: 4 (최근 30일)
SB
SB 2019년 3월 12일
답변: Dhanashree Mohite 2019년 3월 20일
Is there any way to call the 'rename all' button found in the goto block's window, from the Matlab command line?
Most parameters can be found (tag, visibility, and icon) and can be accessed from matlab with 'get_param()' and 'set_param()'; however, I cannot seem to find a means to execute this function. It would be very useful in terms of automating Simulink models. Thanks.

답변 (1개)

Dhanashree Mohite
Dhanashree Mohite 2019년 3월 20일
As per my understanding, there is no direct way to call 'rename all' button of goto block's window from matlab command line. But you can do it programmatically. One of the way is:
function RenameAllGoToFrom(CurrentName,RequiredName)
b1 = Simulink.findBlocks('sampleModel','GotoTag',CurrentName);
for i=1:length(b1)
set_param(b1(i),'GotoTag',RequiredName);
end
end
This will find all blocks with current 'GotoTag' and replace it with required one.

카테고리

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

제품


릴리스

R2017a

Community Treasure Hunt

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

Start Hunting!

Translated by