Simulink Model String Replacement

버전 1.0.0.1 (2.14 KB) 작성자: Will Campbell
replace a string in Simulink object names with another
다운로드 수: 758
업데이트 날짜: 2016/9/1

라이선스 보기

mdl_strrep is a utility to identify blocks and other Simulink components that contain a particular string in their name.
MDL_STRREP(OBJECT,S1,S2) replaces all occurrences of the string S1 in the name of a Simulink object and its children with the string S2. This enables the user to remove undesired characters in bulk or replace phrases when the model is used in a different context.

MDL_STRREP(OBJECTS,S1,S2) replaces all occurrences of the string S1 in the name of all Simulink objects defined in a cell array. The function will not include any children of the objects defined. This enables the user to fully specify the objects they wish to manipulate.

Examples:
mdl_strrep(bdroot,' ','_')
replaces spaces in all blocks of current model with an underscore

cr = sprintf('\n');
mdl_strrep(gcb,cr,'')
removes any carriage returns in current block's name and any of its components if it's a subsystem

myblocks = find_system(bdroot,'BlockType','Scope');
mdl_strrep(myblocks,'Scope','Probe')
finds all Scopes in the model and replaces the phrase "Scope" with "Probe"

인용 양식

Will Campbell (2025). Simulink Model String Replacement (https://kr.mathworks.com/matlabcentral/fileexchange/26424-simulink-model-string-replacement), MATLAB Central File Exchange. 검색 날짜: .

MATLAB 릴리스 호환 정보
개발 환경: R2009b
모든 릴리스와 호환
플랫폼 호환성
Windows macOS Linux
카테고리
Help CenterMATLAB Answers에서 Modeling에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!
버전 게시됨 릴리스 정보
1.0.0.1

Updated license

1.0.0.0