Professional Documents
Culture Documents
Matlab assignment
Matlab assignment
Matlab assignment
%1
% a=1+2j;
% mag=abs(a);
% angle=phase(a);
%2
% a=-2+j1;
% mag=abs(a);
% angle=phase(a);
%3
% a=(1+2j).*(-2+j1);
% mag=abs(a);
% angle=phase(a);
%4
% a=(1+2j).*(-2+2j);
% mag=abs(a);
% angle=phase(a);
%1
% c=1;d=2;x=4;
% p1=c.*x+2.*d;
% p2=c.*x-conj(d);
% p=p1/p2;
%2:
% x=2;y=4;z=3;
% l=2.*log10(x)+cos(pi)+abs(y.^2-x.^2)+sqrt(5*x*y);
%3:
% x=-3;
% r=x.^4+4.*x.^3+3.*x^2+6.*x+6;
%4:
% p=3;q=4;
% s=(4.*p+5).*(3.*p+4.*q-10);
%5
% t=2;x=0.5;
% u=x.*e.^(-10.*t);
%6
% a=1;b=2;c=3;
% p=a.^(b.^c);
% c=2;d=3;e=4;
% f=c.^d.^e;
%1
% i=2;j=3;
% k=i.*3/2+j/4-j.^(3/8);
%2
% x=2;y=3.0;z=4.5;
% k=x^2+y/2.0+z*2;
%3
% i=3;
% j=(i+1)*(i^2)-i/2.0;
%4
% A=2.5;
% A=(A+25)*2.5;
% i=A*4;
% k=i^2;
% A=k/20;
%Evaluate the all trigofun for the different value of the thetha;
% theata=30;
% a=sind(theata);
% b=cosd(theata);
% c=tand(theata);
% d=cotd(theata);
% e=secd(theata);
% f=cscd(theata);
%Evaluate the following inverse trigo function for the given value
% k=1/2;
% a=asin(k);
% b=acos(k);
% c=atan(k);
% d=acot(k);
% e=asec(k);
% f=acsc(k);
% r=2;h=3;
% volume=pi^2*r*h;
%2:
% N=1000;
% t=10;
% T=1*2+0;
% Power=(2*pi*N*T)/60;
%3:
% V=250;I=5;R=2;cos=0.8;W=20;
% Efficiency=(v*I*cos)/((V*I*cos)+(I^2*R+W));
%1:
% x=5;y=15;z=-2;
% b = x==y || y>x;
% L=0.10/1000;
% R=100;
% c=0.1;
% f1=1/(L*c);
% f2=R^2/(4*(c^2));
% f=sqrt(f1-f2);
%Assignment chapter number 3
%for the given row and coloumn vector solve the following
% p=[1 -2 5];
% q=[2 4 8]';
% k=p*q;
% a=q*p;
% b=p'*q';
% c=sum(p);
% d=sum(q);
% e=mean(p);
% f=mean(q);
% g=length(p);
% h=length(q);
% i=max(p);
% j=max(q);
% a1=min(p);
% a2=min(q);
% a3=prod(p);
% a4=prod(q);
% a5=sort(p);
% a6=sort(q);
%1:
% k=sin(60);
% z=sym('z');
% e=sym('e');
% x=sym('x');
% a2=A(1,:);%All the element from the first row but all the coloumn;
% % q(2,2)=[];
% B=[-1,1,1,5+1i*2;0,-1,0,20+1i*10;0,0,-1,10+1i*3;1,0,0,0;30+1i*30,50+1i*50,60+1i*60,0];
% B(:,end)=[];
% B(end,:)=[];
% k=q(1:2,1:2);
% q(2,2)=8;
% a1=reshape(p,[],1);
% a2=reshape(p,[4,3]);
% a3=reshape(p,[6,2]);
% x=[0 1 2];
% y=[0 2 3 4];
% p=[y,x];
%Generate the following 3x3 matrices of common uses with the help of matrix
% a1=diag(A);
% k=rand(4);
% % p=magic(4);
% % k=randi(4);
% k=k*10;
% k1=round(k);
%For the given matrix determine the determinant and inverse if exist;
%1:
% b=inv(A);
% b=inv(A);
% b=inv(A);
% b=inv(A);
% a1=rank(L);
% a1=rank(L);
% a1=rank(L);
% a1=rank(L);
% a1=rank(L);
%1:
% A=[3 2 1]';
% B=[6 1 0];
% a1=A*B;
% a2=B*A;
% a3=A*A';
% a4=B'*B;
%2:
% a1=A*B;
% a2=B*A;
% a3=A*A';
% a4=B'*B;
%3:
% a1=A*B;
% a2=B*A;
% a3=A*A';
% a4=B'*B;
% Evaluate
% a1=A+B;
% a2=A-B;
% a3=A.^3;
% a4=B.^4;
% a5=A/B;
%for the given equation the matrix A is:
% const=[2 2 0]';
% a2=inv(A);
% soln=A\const;
% [V,D]=eig(A);
% a3=trace(A);
% a4=rank(A);
% a5=A';
% const=[4 4 0]';
% a2=inv(A);
% soln=A\const;
% [V,D]=eig(A);
% a3=trace(A);
% a4=rank(A);
% a5=A';
% x=[1 0 -2];
% y=[0 -4 8];
% a1=x>y;
% a2= x==y;
% a3=(x&y);
%Evaluate:
% x=[0 2 4];
% y=x.^4;
% y1=x.^5;