Coordinates of an area graph
2 次查看(过去 30 天)
显示 更早的评论
I've got 9 equations (correspond Y-axe) and 9 sections (correspond X-axe) from which I plot an Area Graph.
Equations:
M1 = -F_E_1*sind(alpha_E_1+gama_1)*(x1) + F_E_2*sind(alpha_E_2+gama_1)*(x1);
M2 = M1i_max + T1i_max*(x2) + F_D*sind(alpha_D+gama_1)*(x2);
M3 = M2i_max + T2i_max*(x3) - F_C_1*sind(alpha_C_1-gama_1)*(x3);
M4 = M3i_max + N3i_max*R_1*(1-cosd(phi_4)) + T3i_max*R_1*sind(phi_4);
etc
x-axe sections:
x1p = 0 : l1/50 : l1;
x2p = l1 : l2/50 : l1+l2;
x3p = l1+l2 : l3/50 : l1+l2+l3;
x4p = l1+l2+l3 : ra4/50 : l1+l2+l3+ra4;
etc
Ten I plot the Area graph:
subplot(3,1,3); % Moments
title('Momentové složky [Nmm]')
hold on
area(x1pr,M1r);
area(x2pr,M2r);
area(x3pr,M3r);
area(x4pr,M4r);
area(x5pr,M5r);
area(x6pr,M6r);
area(x7pr,M7r);
area(x8pr,M8r);
area(x9pr,M9r);
set(gca,'XTick', 0:50:1200);
grid on
colorbar
And the final result is here:
Now I need to find coordinates of the point, where is maximum.
I found maximum by:
maximumM=max([M1 M2 M3 M4 M5 M6 M7 M8 M9 ]); %max M
So I have the y-axe value (which is › Max: 141499.264 [Nmm])
But I don't know how to find the location of this maximum. The problem is (maybe) because the plot curve is not from 1 equation, but from 9 of them. I don't know if this is problem.
Can anybody help please? I tried to find the solution here and in google but to no avail.
0 个评论
采纳的回答
Mahdi
2013-4-1
My solution would be to use the find() function. Since you have the max, you can search the data for where that value exists and then use that value to determine where it is on the x-axis:
Index1=find(y==141499.264) % Finds where in y-data the point is found
x(Index1) % Gives you the same spot with the x-value outputted.
This assumes that the x and y are in one matrix for all of the values. Otherwise, you can look through each matrix if that y-value exists.
3 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Graphics Object Programming 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!