Intercept of two polynomial of degree 2 graphs
Show older comments
i plotted two graphs, then using 'fit' function i interpolated to polynomial degree two. i can see the point of interception. But i want a function that wil calculate the values of X & Y at which both graphs inrecepts.
See the matlab code and the graph
%Plot the Q-H, Q-P, Q-n graph from the data set.
X1=xlsread('PAT Raw Lab data_plot.xlsx','N2:N331'); % x-axis column for time duration in weeks
Y1=xlsread('PAT Raw Lab data_plot.xlsx','O2:O331');
Z1=xlsread('PAT Raw Lab data_plot.xlsx','R2:R331');
Z2=xlsread('PAT Raw Lab data_plot.xlsx','S2:S331');% y-axis column for weekly ave windspeed (m/s)
figure(1)
f1=fit(X1,Y1,'poly2');
f2=fit(X1,Z2,'poly2');
yyaxis left
p1=plot (f1,X1,Y1,'c*');
ylabel ('Head (H)');
hold on
yyaxis right
p2=plot(f2,X1,Z2,'b*');
hold off
title (' Q-H, & Q-n Characteristic Curve');
xlabel ('Discharge (Q)');
ylabel ('Efficiency (n)');
legend ('Q-H data','Poly deg2 curve','Q-n','Poly deg2 curve');
Please, how can i get the corresponding value of the interception on the Y and X axis?
Answers (1)
darova
on 15 Apr 2020
0 votes
Try this (not tested)

2 Comments
Alexander Abadom
on 15 Apr 2020
Edited: darova
on 15 Apr 2020
darova
on 15 Apr 2020
Didn't realized that you have 2 different Y axes. It's because the curves don't intersect actuallly
Categories
Find more on Polynomials in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!