MATLAB 帮助中心
Get available simulink.sampletimecolors.Palette objects
simulink.sampletimecolors.Palette
Since R2024b
simulink.sampletimecolors.getPalette(option)
simulink.sampletimecolors.getPalette('Name'='Value')
simulink.sampletimecolors.getPalette(option) returns one or more simulink.sampletimecolors.Palette objects based on the option specified by option.
option
example
simulink.sampletimecolors.getPalette('Name'='Value') returns a single simulink.sampletimecolors.Palette object with the specified Name property.
Name
collapse all
simulink.sampletimecolors.getPalette
Create a custom color palette object with the name myFirstPalette.
myFirstPalette
pltObj = simulink.sampletimecolors.Palette('myFirstPalette') Palette with properties: Name: "myFirstPalette" ContinuousSampleTimeColors: [0 0 0] FixedInMinorStepSampleTimeColors: [0.4902 0.4902 0.4902] ContinuousVariableSampleTimeColors: [0.4902 0.4902 0.4902] DiscreteSampleTimeColors: [3x3 double] AsynchronousSampleTimeColors: [0.7529 0.3608 0.9843] AperiodicPartitionColors: [0.7529 0.3608 0.9843] InitializeEventSampleTimeColors: [0.7961 0.5176 0.3647] TerminateEventSampleTimeColors: [0.7961 0.5176 0.3647] ResetEventSampleTimeColors: [0.7961 0.5176 0.3647] ReinitializeEventSampleTimeColors: [0.7961 0.5176 0.3647] ConstantSampleTimeColors: [0.8196 0.0157 0.5451] MultirateSampleTimeColors: [0.5451 0.4000 0.0235] UnionSampleTimeColors: [0.4039 0.2980 0.0235]
Customize colors for the discrete sample time and continuous sample time using RGB values.
mypalette.DiscreteSampleTimeColors = [0.9 0.2 0.4]; mypalette.ContinuousSampleTimeColors = [0.7 0.5 0.3]
List all existing palettes using the simulink.sampletimecolors.getPalette function with the 'all' option.
'all'
listOfPalettes = simulink.sampletimecolors.getPalette('all') names = [listOfPalettes.Name]
names = 1×2 cell array {["myFirstPalette"]} {["default (built in)"]}
List the palette that is currently active using the simulink.sampletimecolors.getPalette function with the 'active' option.
'active'
simulink.sampletimecolors.getPalette('active')
ans = Palette with properties: Name: "default (built in)" ContinuousSampleTimeColors: [0 0 0] FixedInMinorStepSampleTimeColors: [0.4902 0.4902 0.4902] ContinuousVariableSampleTimeColors: [0.4902 0.4902 0.4902] DiscreteSampleTimeColors: [3×3 double] AsynchronousSampleTimeColors: [0.7529 0.3608 0.9843] AperiodicPartitionColors: [0.7529 0.3608 0.9843] InitializeEventSampleTimeColors: [0.7961 0.5176 0.3647] TerminateEventSampleTimeColors: [0.7961 0.5176 0.3647] ResetEventSampleTimeColors: [0.7961 0.5176 0.3647] ReinitializeEventSampleTimeColors: [0.7961 0.5176 0.3647] ConstantSampleTimeColors: [0.8196 0.0157 0.5451] MultirateSampleTimeColors: [0.5451 0.4000 0.0235] UnionSampleTimeColors: [0.4039 0.2980 0.0235]
Apply the new custom palette to the current MATLAB® session.
simulink.sampletimecolors.applyPalette('myFirstPalette')
'UserDefault'
simulink.sampletimecolors.Palette object or objects to get, specified as 'all', 'active', or 'UserDefault'.
all – Get a list of all the palette objects available.
all
active – Get the currently active palette object.
active
UserDefault – Get the palette object that is set as a default palette in preferences.
UserDefault
Name property the simulink.sampletimecolors.Palette object that you want to return, specified as a string or a character vector.
Example: simulink.sampletimecolors.getPalette('Name'='myFirstPalette')
simulink.sampletimecolors.getPalette('Name'='myFirstPalette')
Introduced in R2024b
simulink.sampletimecolors.Palette | simulink.sampletimecolors.applyPalette | simulink.sampletimecolors.removePalette | simulink.sampletimecolors.storePalette
simulink.sampletimecolors.applyPalette
simulink.sampletimecolors.removePalette
simulink.sampletimecolors.storePalette
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
选择网站
选择网站以获取翻译的可用内容,以及查看当地活动和优惠。根据您的位置,我们建议您选择:。
您也可以从以下列表中选择网站:
如何获得最佳网站性能
选择中国网站(中文或英文)以获得最佳网站性能。其他 MathWorks 国家/地区网站并未针对您所在位置的访问进行优化。
美洲
欧洲
亚太
联系您当地的办事处