% Workshop Example 3 (WorkshopEx03.m) % % This example illustrates a Proper Plot clear clc echo on x = 0:0.05:4 y = f321(x) yp = fp321(x) plot(x,y,'-b',x,yp,'--r') title('Example of a Proper Plot') xlabel('Displacent') ylabel('Amplitude') grid legend('f321','fp321','Location','NorthEast') hold on % Find the zero of the derivative near x = 2.5 x1 = fzero(@fp321,2.5) y1 = f321(x1) plot(x1,y1,'or') text(x1,y1-0.25,'Local Minimum') hold off echo off