Assignment 1... aaaa
Assignment 1... aaaa
ID -I.D. = 2023UEE2022
2022UEE1927
Que.1
(a) Compute the RMS value of the vector by using the command sqrt(),mean(), and ^.2.
A =
B =
clear
B=[9;2;0];
A=[3 7 -1.5;0 3.2 1;1/9 -12 0]
X=inv(A)*B
Output:
A =
X =
3.8594
0.0357
1.8856
Que.3 plot the graph of sin(x) and cos(x) in same graph over interval [0,2*pi].
clc
clear
l=0:pi/10:2*pi;
hold on
a=sin(l);
u=plot(l,a);
b=cos(l);
k=plot(l,b,"k");
hold off
grid on
Output:
Que.4 Find the magnitude and Angle of complex number z=5-3j.
clear
z=5-3j;
mag_z=abs(z)
Angle_z=angle(z)
Angle__z=Angle_z*pi/180
Output:
mag_z =
5.8310
Angle_z =
-0.5404
Angle__z =
-0.0094
Que.5 Find the Real and imaginary part of complex number v=(5+9j)*(7+j)/(3-2j).
clear
v=(5+9j)*(7+j)/(3-2j)
imaginary=imag(v)
Real_part=real(v)
Output:
v =
-4.4615 +19.6923i
imaginary =
19.6923
Real_part =
-4.4615
clear
A=[5 3 2]
Roots_A=roots(A)
Output:
A =
5 3 2
Roots_A =
-0.3000 + 0.5568i
clear
a=5; x=2; y=8;
z=exp(-a)*sin(x)+10*sqrt(y)
Output:
z =
28.2904
Que.8 If the Resistance 10oh, the current increase 0 to 10 with increment 2, than find the
current, voltage and Power dicipiation and show in the graph.
clear
I=0:2:10;
R=10;
voltage=I.*R;
Power_Dissipiation=I.^2*R;
sol=[I;voltage;Power_Dissipiation]
hold on
plot(I,voltage,"r")
plot(I,Power_Dissipiation,"k",LineWidth=2)
xlabel "Current"
ylabel 'Y values'
title 'Sample Plot'
legend ('voltage','power')
hold off
Output:
sol =
Columns 1 through 2
0 2
0 20
0 40
Columns 3 through 4
4 6
40 60
160 360
Columns 5 through 6
8 10
80 100
640 1000
Que.9 Find the below Question using the matrix A=[3 9 1;4 8 6;8 2 0].
1
6
0
C =
3 9 1
4 8 6
D =
d1 =
7
Que.10 By using the matrix A =[3 9 1;4 8 6;8 2 0] solve the below Questions.
A =
3 9 1
4 8 6
8 2 0
Decending_Order =
8 9 6
4 8 1
3 2 0
Accending_Order =
1 3 9
4 6 8
0 2 8
E =
V =
Que.11 Solve y=(z.^3 + 5*z)/(4*z.^2 - 10). Create a vector z with six element
with interval[1,11].
clear
z=linspace(1,11,6)
y=(z.^3 + 5*z)./(4*z.^2 - 10)
Output:
z =
1 3 5 7 9 11
y =
Columns 1 through 5
Column 6
2.9241
clc
clear
x=pi/5
LHS=cos(x/2).^2
RHS=(tan(x) +sin(x))/(2*tan(x))
Output:
x =
0.6283
LHS =
0.9045
RHS =
0.9045