How can I find intersections of curves?

조회 수: 1 (최근 30일)
Rengin
Rengin 2015년 6월 12일
답변: Star Strider 2015년 6월 12일
clear all
clc
Reactive_QCP1=[6.708;6.396;6.0911;5.791;5.498;5.210;4.926;4.647;4.371];
Reactive_QCP2= [17.053;13.255;9.590;6.0533;2.632;-0.683;-3.903;-7.034;-10.083];
ReactiveChange=(-40:10:40)';
Graph_1=plot(Reactive_QCP1(:,1),ReactiveChange(:,1),'b');
grid on
hold on
Graph_2=plot(Reactive_QCP2(:,1),ReactiveChange(:,1),'r');
xlabel('Reactive Power Change of WF [p.u]');
ylabel('QCPs [Mvar]');
Graph_3=line([-15 20],[0 0],'color','k');
hleg2=legend('QCP1','QCP2','Location','NorthEastOutside');
% I want to see the coordinates where Graph_1 and Graph_3 intersect.
% How can I do that? Thanks a lot

답변 (1개)

Star Strider
Star Strider 2015년 6월 12일
Since ‘Graph3’ is the x-axis where y = 0, you can use interp1 to find the intersection of Graph1:
G1G3Intx = interp1(ReactiveChange, Reactive_QCP1(:,1), 0);
This will give you the value of ‘Reactive_QCP1’ where ‘ReactiveChange’ is zero. Is that what you want?

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by