Exam Roll No 52820035

  • Upload
    sudip

  • View
    221

  • Download
    0

Embed Size (px)

DESCRIPTION

asdasdsa

Citation preview

Exam roll no 52820035Rabin DangiQ.1 Ansx=[0:0.01:10]y=X.^2-4X-10;plot(x,y);xlabel('x');ylabel('X.^2-4*x-10');title('x.^2-4X-10 graph');grid on;axis equal;

Q.2 ansx=[0:20:3000]y=sin(x);subplot(2,2,1);plot(x,y,'r');xlabel('x');ylabel('sin(x)');

y=cos(x);subplot(2,2,2);plot(x,y,'g');xlabel('x');ylabel('cos(x)');

y=x.^2;subplot(2,2,3);plot(x,y);xlabel('x');ylabel('x.^2');

y=x.^3-4*x.^2+6;subplot(2,2,4);plot(x,y,'k');xlabel('x');ylabel('polynomial');end

Q.3 ansn=input('enter the number:');X=1;for i=1:nfprintf('factorial=%g',f*i);endQ.4 ansa=input('enter your choice:\n 1.add\t 2.sub\n')fprintf('enter your choice:\n 1.add\t 2.sub\n')if a==1p=input('enter p');q=inpu('enter q');r=p+q;fprintf('sum=%g',r);elseif a==2p=input('enter p');q=inpu('enter q');r=p-q;fprintf('diff=%g',r);end

q.5 ansa=input('enter a:')for b=1:10fprintf('%g*%g=%g\n',a,b,a*b)end