Download as pdf
Download as pdf
You are on page 1of 3
MATLAB ASSIGNMENT Name-SACHIN Roll No-22MMI0007 MAXIMA AND MINIMA CODING- clearall cle clear alt syms x y f(x,y)=input ("Enter the Function(x,y):") paditt (t,x); G=diff (fry); [ax,ayl=solve(p,q); ax=doublelax ay=double(ay F=diff(p,x); s=diff (py); t=diff(qsy); Derat-s72; figure fsurf(f); Legstr=( "Function Plot"); for :size(ax) Th=D(ax( 4) ,ay(4)); Te=r(ax(i) say (i) ): T3=f(ax(1)ay()) ) if(doubte(T1 sprintf (‘At (4f,Af)further investigation 1s required',ax(4),ay(y)) legstr=[legstr{‘Case of Further investigation’ }]; mkr=" ko elseif (doubte(T1)<0) sprintf('The point (ef,Sf) is a saddle point*,ax(4),ay(4)) legstr=[legstr,{'Saddle Point*}]; — mkr="bv'; else if (double(T2)<8) sprintf( ‘The wf)! ax(i),ay(4),13) legstr=[legstr,{*Maximum value of the function sprintf('The mi alue of the function is f(sf f)=%F*,ax() ay), 73) legstr=[legstr,{*Minimum value of the function'}; end end hold _o plot3(ax(i),ay(i),73,mkr, ‘Linewidth’ ,4); end legend( Legstr, ‘Location’, { : te) he fockn “ly WO de fovea 39 6 low ele a . et pitewn te 9 poe 4A onli), 46) 2) fashe S pape 7 aes er a | inky = t ye, tol od pile : att lout), Py Fsinkr , "Lronlis i) vf bel (lash, "Leeder, ed) Va cn ey Gee fo») (soda fe ol tay AO, ss ais) 0 (G2? ay nye sie lad pe HOw I jana Oo) 5 v= bff Cr), off Crys aff es fav f= Ut BE lo) (Tle D forts, 04 0°)? co yen), seas) T ne a Je e il ¢ Sih wl 19) priser Jape aghiegihe, bietlh ot m ke= Iontg be gente (7230) PEEL

You might also like