Vectorized set_param

버전 1.2.0.1 (2.91 KB) 작성자: Will Campbell
Set multiple Simulink® systems and block parameters in a single call.
다운로드 수: 671
업데이트 2016/9/1

라이선스 보기

Are you like me and finding yourself wanting to change the parameters of multiple Simulink objects at once? Do you run find_system only to then take the output and use it in a for loop that calls set_param? Are you tired of your for loop crashing because a block name has a carriage return or an apostrophe? Well if this is you, I have a simple utility that can make life easier.
SET_PARAMS(OBJECTS,'PARAMETER1',VALUE1,'PARAMETER2',VALUE2,...) is a vectorized form of SET_PARAM that works with cellstrs. It sets parameters within OBJECTS to the specified values. This enables the user to change multiple objects in a single call, work directly with output from find_system, and easily work with blocks that contain carriage returns and/or apostrophes.

Examples:
set_params({'model/block1' 'model/subsystem1/block2'},'FontName','Courier New')
will change block1 and block2 to use Courier New as their font

set_params(find_system(bdroot,'BlockType','Scope'),'BackgroundColor','lightBlue')
will set the background color of all Scopes in the current Simulink model to light blue.

인용 양식

Will Campbell (2026). Vectorized set_param (https://kr.mathworks.com/matlabcentral/fileexchange/26271-vectorized-set_param), MATLAB Central File Exchange. 검색 날짜: .

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

Updated license

1.2.0.0

rephrased title

1.1.0.0

Updated copyright for 2010