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 Center および File ExchangeExploration and Visualization についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by