How to find Max value, X intercept, y intercept of multiple lines from a graph.
4 次查看(过去 30 天)
显示 更早的评论
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.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1118195/image.jpeg)
0 个评论
回答(1 个)
vamshi sai yele
2022-9-14
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 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Specifying Target for Graphics Output 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!