필터 지우기
필터 지우기

How to change the figure color in simulink scopes using a script?

조회 수: 8 (최근 30일)
Markus Gurtner
Markus Gurtner 2019년 6월 21일
댓글: Markus Gurtner 2019년 6월 21일
Hy everyone!
I'm trying to write a script which adjusts the apperance of all scopes in a currently open Simulink Model.
Unfortunatley I could not manage to access and set the "Figure Color" property from the script.
Unbenannt.JPG
The remaining features of interest are manipulated with:
scopes = find_system(gcs,'blocktype','Scope');
shh = get(0,'ShowHiddenHandles');
set(0,'ShowHiddenHandles','On');
for i = 1:length(scopes)
set_param (scopes{i},'open','on');
a = findobj (gcf,'type','axes'); %
set(a,'Color',[1 1 1]); % set white background
set(a,'XColor',[0 0 0]); % set x axis font color
set(a,'YColor',[0 0 0]); % set y axis font color
set(a,'ZColor',[0 0 0]); % set z axis font color
set(a,'ColorOrder',myColorMap); % set custom colormap
end
set(0,'ShowHiddenHandles',shh);

답변 (1개)

Himanshu Tripathi
Himanshu Tripathi 2019년 6월 21일
Replace
set(a,'ColorOrder',myColorMap);
by
colormap(a,myColorMap);
  댓글 수: 1
Markus Gurtner
Markus Gurtner 2019년 6월 21일
Thanks for your answer!
Unfortunatley this does not solve the initial issue of changing the "Figure Color" property.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Scopes and Data Logging에 대해 자세히 알아보기

제품


릴리스

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by