MATLAB Answers

How to show/ indicate the absolute Maximum and Minimum on a plot in matlab?

14 views (last 30 days)
Rahul Ranga Rao Koduri
Rahul Ranga Rao Koduri on 10 Dec 2019
Commented: Joe Vinciguerra on 10 Dec 2019
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

Answers (1)

Image Analyst
Image Analyst on 10 Dec 2019
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 Comments

Sign in to comment.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by