How to find Max value, X intercept, y intercept of multiple lines from a graph.
3 views (last 30 days)
Show older comments
Hey,
I need to find Max value, X intercept, Y intercept of all the curves in the graph and put them in a matrix. (graph attached below)
plot(naca2412RE5{:,1}, naca2412RE5{:,2}, naca2412RE10{:,1}, naca2412RE10{:,2}, ...
naca2412RE15{:,1},naca2412RE15{:,2},naca2412RE20{11:end,1},naca2412RE20{11:end,2}, ...
naca2412RE25{:,1},naca2412RE25{:,2},naca2412RE30{:,1},naca2412RE30{:,2});
Now I can zoom in manually note the values and make a matrix, but it would take a lot of time since I have several graphs.
How do I find all the three parameters for all the curves?
Thank you.
0 Comments
Answers (1)
vamshi sai yele
on 14 Sep 2022
As per my understanding you want to figure out the maximum point, X-intercept and Y-intercepts from a graph.
I tried it from my end and below is the attached the code for the same,
a1 = 73000;
x5 = 30000
y3 = 950;
b1 = 5.92;
c = 0.015;
e = .9;
k_3 = 1/(pi*e*b1);
k_2 = 0;
k_1 = (1/3)*k_3;
K = k_1+k_2+k_3;
V = linspace(400, 2400, 1000);
rho = 8.9068*10^(-4);
C_l = ((2*a1)./(rho*V.^2*y3));
C_d = c+K*(C_l).^(2);
T_r = (1/2*rho.*V.^2.*y3.*C_d);
D = T_r;
P_r = V.*T_r;
T_a = 13850*2;
P_a = V.*T_a;
intx_V = interp1(P_r-P_a, V, 0);
intx_Pr = interp1(V, P_r, intx_V);
figure
hold on
plot(V, P_r)
plot(V, P_a)
plot(intx_V, intx_Pr, 'sr')
hold off
pks = max(P_r,P_a)
text(intx_V,intx_Pr, sprintf('(%6.1f, %9.1f) \\rightarrow', intx_V,intx_Pr), 'HorizontalAlignment','right', 'VerticalAlignment','middle')
while running through files for the solution, I found few resources which help not only in this scenario but these reference might also helps in similar context when you want to spread the wings of your code scope.
Helpful resources for your reference in similar context are listed below.
Hope you will find them helpful!
0 Comments
See Also
Categories
Find more on Creating and Concatenating Matrices 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!