フィルターのクリア

How to display the state variable in a graphic?

1 回表示 (過去 30 日間)
Daniela  Tavarez
Daniela Tavarez 2014 年 9 月 26 日
コメント済み: Walter Roberson 2020 年 11 月 4 日
In simulink, when you have a graphic with many variables curves, how do you can distinguish one variable from another?

回答 (1 件)

Avinash Mangena
Avinash Mangena 2020 年 11 月 4 日
You can use “plot(___,Name,Value)” which is used to distinguish one variable from another.
This specifies line properties using one or more Name,Value pair arguments. For a list of properties, see Line Properties[AV1] [AM2] . Use this option with any of the input argument combinations in the previous syntaxes. Name-value pair settings apply to all the lines plotted.
For better understanding you can refer to following example:
x = linspace(0,10);
y1 = sin(x);
y2 = sin(0.9*x);
y3 = sin(0.8*x);
y4 = sin(0.7*x);
y5 = sin(0.6*x);
y6 = sin(0.5*x);
plot(x,y1,'DisplayName','sin(x)')
hold on
plot(x,y2,'DisplayName','sin(0.9x)')
plot(x,y3,'DisplayName','sin(0.8x)')
plot(x,y4,'DisplayName','sin(0.7x)')
plot(x,y5,'DisplayName','sin(0.6x)')
plot(x,y6,'DisplayName','sin(0.5x)')
hold off
lgd = legend;
lgd.NumColumns = 2;
hope it helps !
  1 件のコメント
Walter Roberson
Walter Roberson 2020 年 11 月 4 日
This would be within a matlab function block

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeLegend についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by