MATLAB: Display max ,min and a value of array in plot

maxplot

hello everyone, Im trying to disply the values of max, min and average of the relative error in the graph
A= matrix 20×2
V_interpolation = matrix 20×1
V_exper = -A(:,2);
r_exper = A(:,1);
Absuolut_Error = -abs(V_interpolation – V_exper);
Relative_Error = -abs(Absuolut_Error/(V_exper))
Max= max(Relative_Error);
Min= min(Relative_Error);
Average = mean(Relative_Error);

Best Answer

Use plot() if you want to indicate with a marker. Use yline() or line() if you want to draw a line from the axis. Use sprintf() and text() if you want to put text onto the graph.