Help in plotting a graph

1 回表示 (過去 30 日間)
Indrani
Indrani 2023 年 9 月 29 日
コメント済み: Voss 2023 年 9 月 29 日
How do I plot a graph like this? I am not that interested in the values and all. I just want my graph to look like this

採用された回答

Voss
Voss 2023 年 9 月 29 日
% some data:
f = linspace(0.03,0.09,100); % row vector (1xn)
x = [-1/0.06*(f-0.06)-12; 25*exp(-40*(f-0.03))-10; 1-(f-0.09)/0.09]; % 3xn matrix of curves' data
figure
plot(f,x(1,:),'b','LineWidth',2)
hold on
plot(f,x(2,:),'r--','LineWidth',2)
plot(f,x(3,:),'k:','LineWidth',2)
box off
xlabel('Frequency(Hz)')
ylabel('Damping Ratio')
legend({'Power Mode','Opening Mode','Isolated Mode'},'Box','off')
  2 件のコメント
Indrani
Indrani 2023 年 9 月 29 日
Thank you!
Voss
Voss 2023 年 9 月 29 日
You're welcome!

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

その他の回答 (1 件)

Image Analyst
Image Analyst 2023 年 9 月 29 日
Try this:
numPoints = 1000;
x = linspace(0.03, 0.09, numPoints);
y = linspace(15, -10, numPoints);
plot(x, -12*ones(numPoints, 1), 'LineWidth', 3, 'Color', 'b')
hold on;
plot(x, y, 'r--', 'LineWidth', 3)
plot(x, 2 * ones(numPoints, 1), 'LineWidth', 3, 'Color', 'k')
ylabel('Damping Ratio');
xlabel('Frequency (Hz)');
legend('Power Mode', 'Opening Mode', 'Isolated Mode');
To learn other fundamental concepts, invest 2 hours of your time here:
  1 件のコメント
Indrani
Indrani 2023 年 9 月 29 日
I will sign up for the course, thanks!

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

カテゴリ

Help Center および File Exchange2-D and 3-D Plots についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by