MATHS LAB ASSIGNMENT 5.pdf - MATLAB ASSIGNMENT 1 Name...

This preview shows page 1 - 3 out of 8 pages.

MATLAB ASSIGNMENT 1 Name- Akshat Gupta Reg No.- 19BIT0068 Slot- L37+L38 Course- MAT1011-Calculus for Engineers- Embedded Lab Q1- Verify Rolle’s theorem for the function (x+2) 3 (x-3) 4 in the interval [-2,3]. Plot the curve along with the secant joining the end points and the tangents at points which satisfy Rolle’s theorem. ; ; ;
hold on ; plot(r(i),tval(i), 'ok' ); end hold on ; secant_slope=(fb-fa)/(b-a); secant_line=fa+secant_slope*(x-a); sx_val=xval; sy_val=subs(secant_line,x,sx_val); hold on ; plot(sx_val,sy_val, 'g' ); hold off ; legend( 'Function' , 'Tangent' , 'Point' , 'Secant' ); title( 'Demonstration of Rolles theorem' ); Output Graph

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture