MATLAB 도움말 센터
Get line color in comparison plot
Since R2021b
color = Simulink.sdi.getComparisonColor(opt)
color = Simulink.sdi.getComparisonColor(opt) returns the color of the comparison plot element specified by opt.
color
opt
example
collapse all
Open the vdp model.
vdp
mdl = "vdp"; open_system(mdl)
In the model, set the value of the Mu block to 1.2. Alternatively, you can use the set_param function to set the value of the block programmatically.
Mu
1.2
set_param
set_param("vdp/Mu","gain","1.2")
Simulate the vdp model to create a run.
sim(mdl);
Set the value of the Mu block to 0.5. Then, simulate the model again to create another run.
0.5
set_param("vdp/Mu","gain","0.5") sim(mdl);
Compare the two runs. For more information about how to interactively compare data, see Compare Simulation Data.
runIDs = Simulink.sdi.getAllRunIDs; runID1 = runIDs(end-1); runID2 = runIDs(end); diffResult = Simulink.sdi.compareRuns(runID1,runID2);
Set the baseline run color to purple using a 1-by-3 RGB vector.
Simulink.sdi.setComparisonColor("baselineColor",[0.7 0.27 1])
Use the Simulink.sdi.getComparisonColor function to get the 1-by-3 RGB vector for the line color of the comparison run.
Simulink.sdi.getComparisonColor
compColor = Simulink.sdi.getComparisonColor("compareToColor")
compColor = 1×3 0.8510 0.3255 0.0980
"baselineColor"
"compareToColor"
"toleranceColor"
"differenceColor"
Comparison plot element for which to set the color, specified as:
"baselineColor" — Baseline signal
"compareToColor" — Comparison signal
"toleranceColor" — Tolerance band
"differenceColor" — Difference between baseline and comparison signals
Example: "baselineColor"
Line color, returned as a 1-by-3 RGB vector with values between 0 and 1.
0
1
Introduced in R2021b
Simulink.sdi.setComparisonColor
Simulink.sdi.compareSignals
Simulink.sdi.compareRuns
Simulink.sdi.DiffRunResult
Simulink.sdi.DiffSignalResult
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 사이트 방문이 최적화되지 않았습니다.
미주
유럽
아시아 태평양
지역별 지사에 문의