how to extend the plot with slope of last two points till the boundary. Boundaries can be dictated by peak of adjacent plots

조회 수: 3 (최근 30일)
In the attached figure, curve 1 has to extend till boundary. How can i do that?
  댓글 수: 3
Meddi Tharun
Meddi Tharun 2020년 5월 6일
X1 = linspace(2,3,20);
Y1 = linspace(1/1000, 1,20);
X2 = linspace(14,15,30);
Y2 = linspace(1/10000, 1,30);
Using semilogy to plot data.
Meddi Tharun
Meddi Tharun 2020년 5월 6일
Sorry, for incomplete code to generate given plots.
X1 = linspace(2,3,20);
Y1 = linspace(1/1000, 1,20);
Y1Dash = flip(Y1);
X2 = linspace(14,15,30);
Y2 = linspace(1/10000, 1,30);
Y2Dash = flip(Y2);
figure;semilogy(X1, Y1Dash, "-r*");hold on;grid on;
semilogy(X2, Y2Dash, "-r*");hold off;
legend("curve1", "Curve2");

댓글을 달려면 로그인하십시오.

답변 (1개)

KALYAN ACHARJYA
KALYAN ACHARJYA 2020년 5월 6일
편집: KALYAN ACHARJYA 2020년 5월 6일
Multiple way: One option
X1 = linspace(2,3,20);
Y1 = linspace(1/1000, 1,20);
X2 = linspace(14,15,30);
Y2 = linspace(1/10000, 1,30);
loglog([X1(1),X1],[Y2(1),Y1]);
hold on;
loglog(X2,Y2);
grid on;
  댓글 수: 3
Ameer Hamza
Ameer Hamza 2020년 5월 6일
Meddi, this is a loglog plot. It x-axis and y-axis do not have a zero. Where do you want to connect the 45-degree line on the x-axis?

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Annotations에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by