How to show/ indicate the absolute Maximum and Minimum on a plot in matlab?
11 次查看(过去 30 天)
显示 更早的评论
y0=0
y1=piecewise(x<=0,0, 0<x<4,15408,4<x<=16,(-3424*x) + 29104, x>=16, 0);
fplot (y1, 'b', 'LineWidth', 2);
hold on;
figure (1); fplot(y0, 'black', 'LineWidth', 1);
title ('The Shear Force Diagram')
xlim([-1,17]);
ylim([-27000,16000]);
xlabel('X[ft]');
ylabel ('V[lb]');
I need to show a marker at the absolute maximum on this plot
I know it is at x=16 and y= -2.568e4
1 个评论
回答(1 个)
Image Analyst
2019-12-10
Since you know x and y, how about
hold on;
plot(x, y, 'ro', 'LineWidth', 2, 'MarkerSize', 20); % Plot a circle around the max
Adjust the numerical parameters to your liking.
0 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!