You are on page 1of 8

% Experiment 1.

1
clc
clear all
close all

A = input("Enter the value of matrix A : ");


B = input("Enter the value of matrix B : ");
disp("Addition of two matrix A & B : ");
x =A + B;
disp(x);
disp("Subtraction of two matrix A & B : ");
Y =A - B;
disp(Y);
disp("Multiplication of two matrix A & B : ");
Z =A + B;
disp(Z);

% Experiment 1.2
clc
clear all
close all

syms t a b c
z=input("Enter a Function : ");
disp(z);
y=input("Enter a Function : ");
disp(y);
x=input("Enter a Function : ");
disp(x);

% Experiment 2.1
clc
clear all
close all

syms t a s
f=input("Enter the function : ");
F=laplace(f,t,s);
disp("The laplase transform of the function is : ");
disp(F);

% Experiment 2.2
clc
clear all
close all

syms t a s
f=input("Enter the function : ");
F=ilaplace(f,s,t);
disp("The inverse laplase transform of the function is : ");
disp(F);

% Experiment 3.1
clc
clear all
close all

syms t a s
f=input("Enter the function : ");
F=laplace(f,t,s);
disp("The laplase transform of the function is : ");
disp(F);

% Experiment 3.2
clc
clear all
close all

syms t a s
f=input("Enter the function : ");
F=ilaplace(f,s,t);
disp("The inverse laplase transform of the function is : ");
disp(F);

% Experiment 4.1
clc
clear all
close all

syms a t
f=input("Enter thefunction : ");
df=diff(f,t);
disp("Derivative of the function : ");
disp(df);

% Experiment 4.2
clc
clear all
close all

syms a t x
f=input("Enter the function : ");
l1=input("Enter lower limit : ");
l2=input("Enter upper limit : ");
it=int(f,t,l1,l2);
disp("integration of the function : ");
disp(it);

% Experiment 4.3
clc
clear all
close all

syms a t x s
f=sin(2*t)*(heaviside(t-2*pi)-heaviside(t-4*pi));
f1=laplace(f,t,s);
disp(f1);

% Experiment 4.3
clc
clear all
close all

syms a t x s
f=int(cos(2*t)*dirac(t-pi/4),t,0,inf);
disp(f);

% Experiment 5.1
clc
clear all
close all

syms Y S t
f=exp(-t)*sin(t);
F=laplace(f,t,S);
yo=0;
dyo=1;
Y1=S*Y-yo;
Y2=S*Y1-dyo;
sol=solve(Y2+2*Y1+5*Y==F,Y);
sol1=ilaplace(sol,S,t);
disp(sol1);

% Experiment 6.1
clc
clear all
close all

syms s t w
f=input("Enter the function : ");
F=fourier(f,t,w);
disp("The fourier transform of the above function is : ");
disp(F);

% Experiment 6.2
clc
clear all
close all

syms s t w
f=input("Enter the function : ");
F=ifourier(f,s,w);
disp("The inverse fourier transform of the above function is : ");
disp(F);

% Experiment 7.1
clc
clear all
close all

syms s x b
F(x)=int(sin(s*x)*exp(-b*x),s,0,inf);
disp(F);

% Experiment 7.2
clc
clear all
close all

syms s x b t a
F=(2/pi)*(int(sin(s*x)*exp(-3*s),s,0,inf));
disp(F);
% Experiment 7.3
clc
clear all
close all

syms s x b t a
f=x;
q=2-x;
r=0;
F=int(cos(s*x)*f,x,[0,1]);
Q=int(cos(s*x)*q,x,[1,2]);
R=int(cos(s*x)*r,x,[0,inf]);
W=F+Q+R;
disp(W);

% Experiment 7.4
clc
clear all
close all

syms s x b t a
F=(2/pi)*(int(cos(s*x)*(2+exp(5/2*s)),s,0,inf));
disp(F);

% Experiment 8.1
clc
clear all
close all

syms n m
f=input("Enter the Function : ");
F=ztrans(f);
disp(F);

% Experiment 8.2
clc
clear all
close all

syms n m
f=input("Enter the Function : ");
F=ztrans(f);
disp(F);

% Experiment 8.2
clc
clear all
close all

syms z a b s n
F=ztrans(3^n*cos((n*pi/2)+(pi/4)));
disp(F);

% Experiment 9
clc
clear all
close all

syms z a b n
F=iztrans(2*z/(z-2)^2,n);
disp(F);

% Experiment 10
clc
clear all
close all

syms n m z U
r=3^n;
F=ztrans(r,n,z);
U0=0;
U1=1;
fou=z*(U-U0);
sou=z^2*(U-U0-U1*z^-1);
sol=solve(sou+4*fou+3*U==F,U);
Un=iztrans(sol,z,n);
disp(Un);

% Experiment 11.1
clc
clear all
close all

t=(0:0.001:1)';
y = sin(2*pi*50*t) + 2*sin(2*pi*120*t);
plot(t,y);

% Experiment 11.2
clc
clear all
close all

t=(0:0.001:1)';
y = sin(2*pi*50*t) + 2*sin(2*pi*120*t);
yn = y + 0.5*randn(size(t));
plot(t(1:50),yn(1:50));

% Experiment 11.3
clc
clear all
close all

t = linspace(0,5,5e3);
x = 2*cos(2*pi*100*t).*(t<1)+cos(2*pi*50*t).*(3<t)+0.3*randn(size(t));
plot(t,x);

% Experiment 11.4
clc
clear all
close all

t = linspace(0,5,5e3);
x = 2*cos(2*pi*100*t).*(t<1)+cos(2*pi*50*t).*(3<t)+0.3*randn(size(t));
plot(t,x);
xlabel('Time (s)')
ylabel('Amplitude')

% Experiment 11.5
clc
clear all
close all

Fs=1000;
t = linspace(0,5,5e3);
x = 2*cos(2*pi*100*t).*(t<1)+cos(2*pi*50*t).*(3<t)+0.3*randn(size(t));
cwt(x,Fs)
% Experiment 11.6
clc
clear all
close all

t=(-2*pi:0.001:2*pi)
y=exp((-t.^2).*cos(pi*sqrt(2/log(2)).*t));
plot(t,y);

% Experiment 11.7
clc
clear all
close all

x=(-10:0.01:10)';
y=sin(pi*x)./(pi*x);
plot(x,y);

You might also like