How to take the difference of y axis points at the same value of x-axis from 2 curve at the same graph?
11 views (last 30 days)
I am struggling to take a difference between 2 y axis points at the same x axis value from 2 curve.
x = [20,30,40,50,60,70,80,90,100]
y = [260,350,470,610,625,675,695,750,800]
%Plotting the points on the graph
for i = 2:length(q)
Q = q(i) ;
if h(i-1) < h1
v_2 = ((Q/1000) / Area_Outlet1);
h(i) = 75+((1 / (rho * g)) * (Patm2 - Patm1 + 0.5 * rho * (v_2^2 - v_1^2)) + h_f)*1000
v_2a = ((Q/1000) / Area_Outlet2);
h(i) = 75+h1 + ((1 / (rho * g)) * (Patm2 - Patm1 + 0.5 * rho * (v_2a^2 - v_1^2)) + h_f)*1000
Second curve plotted by using the loop. I want to find out what are the y-axis points at x = [20,30,40,50,60,70,80,90,100] for both curves.