Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
14 views

Assignment 1... aaaa

The document contains a series of MATLAB assignments performed by two students, Vikash Saini and Sukrit Pratap Singh, covering various mathematical computations and visualizations. Key tasks include computing RMS values, solving linear equations, plotting functions, and working with complex numbers and matrices. The document also includes outputs for each computation, demonstrating the results of the assignments.

Uploaded by

sukritsingh085
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views

Assignment 1... aaaa

The document contains a series of MATLAB assignments performed by two students, Vikash Saini and Sukrit Pratap Singh, covering various mathematical computations and visualizations. Key tasks include computing RMS values, solving linear equations, plotting functions, and working with complex numbers and matrices. The document also includes outputs for each computation, demonstrating the results of the assignments.

Uploaded by

sukritsingh085
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

Assignment 1

Name: VIKASH SAINI


NAME - SUKRIT PRATAP SINGH

ID -I.D. = 2023UEE2022
2022UEE1927

Que.1

(a) Compute the RMS value of the vector by using the command sqrt(),mean(), and ^.2.

% Lets assume the A random matrix of 3 order


clear
A=rand(3)
B=sqrt(mean(A^.2))
% part(b) Plot the graph of y=sin(x)
% for x on interval x=0,10.
x=0:0.1:10;
y=sin(x);
plot(x,y,"b")
Output:-

A =

0.8147 0.9134 0.2785


0.9058 0.6324 0.5469
0.1270 0.0975 0.9575

B =

0.6179 - 0.0056i 0.6024 + 0.0066i 0.6129 - 0.0017i


Que.2 Solve the set of linear algebric equations?

clear
B=[9;2;0];
A=[3 7 -1.5;0 3.2 1;1/9 -12 0]
X=inv(A)*B
Output:

A =

3.0000 7.0000 -1.5000


0 3.2000 1.0000
0.1111 -12.0000 0

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

Que.6 Find the roots of quadratic equation A= 5s^2 +3s +2?

clear
A=[5 3 2]
Roots_A=roots(A)
Output:

A =

5 3 2

Roots_A =

-0.3000 + 0.5568i

Que.7 Find the value of the expression z= e(-a)sin(x) +10sqry(y).

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].

(a) Extract the third column of matrix and store in B.


(b) Extract the first and second row of A and store in C.
(c) Find the sum of first two element of column third and store in D.
A=[3 9 1;4 8 6;8 2 0];
% part(a) Extract the third column of matrix and store in B.
B=A(:,3)
% Part(b) Extract the first and second row of a and store in C.
C=A([1,2],:)
% part(c) Find the sum of first two element of column third and store in D.
D=A(1,3)+A(2,3)
d1=sum(A([1,2],3))
Output:
B =

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) Sort the column of Matrix A in descending order


(b) Sort the row of matrix A in descending order.
(c) Find the Eigen value and Eigen vector of matrix A.
clear
A=[3 9 1;4 8 6;8 2 0]
% Part (a) Sort the columns of Matrix A in decending order
Decending_Order=sort(A,1,'descend')
% Part (b) Sort the row of matrix A in decending order.
Accending_Order=sort(A,2,'ascend')
% Part (c) Find the eigen value and eigen vector of matrix A.
[E,V]=eig(A)
Output:

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 =

0.5769 + 0.0000i -0.1084 + 0.4965i -0.1084 - 0.4965i


0.7069 + 0.0000i -0.2690 - 0.3219i -0.2690 + 0.3219i
0.4091 + 0.0000i 0.7522 + 0.0000i 0.7522 + 0.0000i

V =

14.7370 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i


0.0000 + 0.0000i -1.8685 + 4.4249i 0.0000 + 0.0000i
0.0000 + 0.0000i 0.0000 + 0.0000i -1.8685 - 4.4249i

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

-1.0000 1.6154 1.6667 2.0323 2.4650

Column 6

2.9241

Que.12 Verify the trigonometric identity given by cos(x/2).^2=(tan(x) +sin(x))/(2*tan(x))

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

You might also like