EXPERIMENT 2 TASK 3 CODE ; clc clear all A=[2 0 0; -9 -8 -1; 0 8 1;]; B=[6 0 8; 1 8 11; 0 7 -7;]; U=A*B Y=A.*B A^2 A.^2
RESULT U= 12
0 16
-62 -71 -153 8 71 81 Y= 12
0
0
-9 -64 -11 0 56 -7 ans = 4
0
0
54 56
7
-72 -56 -7 ans = 4
0
0
81 64
1
0 64
1
TASK 3 CODE
clc clear all syms t f = 5*exp(-2*t) S = laplace(f) syms s R = 5/(s+2) M = ilaplace(R)
RESULT f = 5*exp(-2*t) S = 5/(s + 2) R = 5/(s + 2) M = 5*exp(-2*t) TASK 4 CODE clc clear all syms t f=8*t^2*cos(3*t+45); s=laplace(f) R=ilaplace(s) pretty(s)
RESULT s = 8*sin(45)*(6/(s^2 + 9)^2 - (24*s^2)/(s^2 + 9)^3) 8*cos(45)*((6*s)/(s^2 + 9)^2 - (8*s^3)/(s^2 + 9)^3) R = 8*t^2*cos(3*t)*cos(45) - 8*t^2*sin(3*t)*sin(45) / 2 | 6 24 s sin(45) | --------- - --------| 2 2 2 3 \ (s + 9) (s + 9)
TASK 5 CODE clc
\ / 3 | | 6 s 8 s | 8 - cos(45) | --------- - --------| | 2 2 2 3 / \ (s + 9) (s + 9)
\ | | 8 | /
clear all;clf t=-5:0.01:5 f1 = 5*exp(-2*t) plot(t,f1) hold on f2 = 5*exp(2*t) plot(t,f2) legend('exp decay','exp inc')
RESULT GRAPH
TASK 6 CODE (sine) clc clear all clf a = input('enter apmlitude=') f = input('enter frequency=') m = input('enter stepsize=') w = input('enter cycle=') t=0:m:1/f; r = a*sin(2*pi*f*t*w) plot(t,r)
RESULT enter apmlitude=5 a = 5 enter frequency=10
f = 10 enter stepsize=0.001 m = 1.0000e-03 enter cycle=5 w = 5
GRAPH
CODE (COsine) clc clear all clf a = input('enter apmlitude=') f = input('enter frequency=') m = input('enter stepsize=') w = input('enter cycle=') t=0:m:1/f; r = a*cos(2*pi*f*t*w) plot(t,r)
RESULTS: enter apmlitude=5
a = 5 enter frequency=10 f = 10 enter stepsize=0.001 m = 1.0000e-03 enter cycle=5 w = 5 GRAPH:
TASK 7 CODE: clc clear all
clf A=[1:6;7:12;13:18;19:24;25:30;31:36;37:42] R=size(A) L=length(A) N=numel(A) x=A(4,:) A(6,:)=zeros(1,6) A(7,:)=ones(1,6) c=A(1,2:end)
RESULTS: A = 1 7 13 19 25 31 37
2 8 14 20 26 32 38
7
6
3 9 15 21 27 33 39
4 10 16 22 28 34 40
5 11 17 23 29 35 41
6 12 18 24 30 36 42
R =
L = 7 N = 42 x = 19
20
21
22
23
24
1 7 13 19 25 0 37
2 8 14 20 26 0 38
3 9 15 21 27 0 39
4 10 16 22 28 0 40
5 11 17 23 29 0 41
6 12 18 24 30 0 42
A =
A =
1 7 13 19 25 0 1
2 8 14 20 26 0 1
3 9 15 21 27 0 1
4 10 16 22 28 0 1
5 11 17 23 29 0 1
2
3
4
5
6
6 12 18 24 30 0 1
c =
Task homework: CODE: clc clear all syms t f=3*t*exp(-2*t)*sin(4*t + 60) s=laplace(f) R=ilaplace(s) RESULT: f = 3*t*exp(-2*t)*sin(4*t + 60) s = (12*cos(60)*(2*s + 4))/((s + 2)^2 + 16)^2 - 3*sin(60)*(1/((s + 2)^2 + 16) ((2*s + 4)*(s + 2))/((s + 2)^2 + 16)^2) R = (3*exp(-2*t)*(4*t*cos(4*t)*sin(60) - sin(4*t)*sin(60) + 4*t*sin(4*t)*cos(60)))/4 + (3*sin(4*t)*exp(-2*t)*sin(60))/4 TASK 11 HOMEWORK: CODE: