How can I setup masked subsystems to have a gradient color background?

조회 수: 8 (최근 30일)
Jason S
Jason S 2013년 12월 16일
댓글: Jason S 2014년 3월 5일
The default subsystem appearance has a color gradient, with white at the top and gray at the bottom.
When I use a masked subsystem, the gradient goes away and I'm left with white or whatever plain color I choose.
How can I setup my masked subsystem to use a color gradient ?
  댓글 수: 2
Ryan G
Ryan G 2013년 12월 17일
Are you looking for a custom color gradient or the default subsystem gradient?
Jason S
Jason S 2014년 3월 5일
the default subsystem gradient

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

답변 (1개)

Jacob Halbrooks
Jacob Halbrooks 2013년 12월 17일
In the Mask Editor, the first tab Icon & Ports allows you to define the block icon. The bottom of the tab shows what drawing commands are available to you. Two of these look of interest for creating a gradient background: patch and image . In MATLAB, patch can be used to create a shape with gradient color, but when I pasted example code, I received an error that I passed too many inputs to patch. As a result, it appears that the patch command in the Editor is a simplified version that probably does not support gradients.
That leaves the image option. I first created my image by doing a PrintScreen with the Subsystem block in view, then cropping the block in a paint program and saving to JPG format. I was then able to use this in the block. You can execute subsequent Mask Editor commands to draw on top of the image, so here is an example using this approach:
image('MaskGradient.jpg');
disp('My Block');

카테고리

Help CenterFile Exchange에서 Author Block Masks에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by