MATLAB ヘルプ センター
Set line color in comparison plot
Since R2021b
Simulink.sdi.setComparisonColor(opt,color)
Simulink.sdi.setComparisonColor(opt,color) sets the color of the comparison plot element opt using the RGB vector specified by color.
opt
color
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, specified as a 1-by-3 RGB vector of doubles with values between 0 and 1.
0
1
Example: [0.7 0.27 1]
[0.7 0.27 1]
Data Types: double
double
Introduced in R2021b
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.
Web サイトの選択
Web サイトを選択すると、翻訳されたコンテンツにアクセスし、地域のイベントやサービスを確認できます。現在の位置情報に基づき、次のサイトの選択を推奨します:
また、以下のリストから Web サイトを選択することもできます。
最適なサイトパフォーマンスの取得方法
中国のサイト (中国語または英語) を選択することで、最適なサイトパフォーマンスが得られます。その他の国の MathWorks のサイトは、お客様の地域からのアクセスが最適化されていません。
南北アメリカ
ヨーロッパ
アジア太平洋地域
最寄りの営業オフィスへのお問い合わせ