Solved Problem Java
Solved Problem Java
FL 210097
f=(1+sqrt (5))/2
x=-5+9i
y=6-2i
x+y
x*y
x-y
x/y
abs(x+y)
6*(35^(1/4))+(14^0.35)
TASK 01
roll_number=210097
x=24+(210097)
y=10+(210097)
z=-2+(210097)
y/x*z
y/(x*z)
sqrt(24+(210097))
sqrt(10+(210097))
sqrt(-2+(210097))
sin (pi/3)
cos (pi/4)
tan (pi/2)
asin (0)
abs (z)
log(x)
exp (y)
a=[1,2+(210097),3,4+(210097),5,6+(210097)]
untitled2
a=
b=a'
untitled2
a=
untitled2
b=
1
210086
3
210088
5
210090
clc
f=(1+sqrt(5))/2
x=-5+9i
y=6-2i
x+y
x*y
x-y
x/y
abs(x+y)
6*(35^(1/4))+(14^0.35)
%% lab-1 task-1
roll_number=210097
x=24+(210097)
y=10+(210097)
z=-2+(210097)
y/x*z
y/(x*z)
%% lab-1 task-2
sqrt(24+(210097))
sqrt(10+(210097))
sqrt(-2+(210097))
%% lab-1 task-3
sin (pi/3)
cos (pi/4)
tan (pi/2)
asin (0)
abs (z)
log(x)
exp (y)
%% lab-1 task-4
a=[1,2+(210097),3,4+(210097),5,6+(210097)]
%% lab-1 task-5
b=a'
%% lab-1 task-6
a=[1,3,5,9]
b=a'
c=a
c(1)
c(3)
c(end-1)=b(end)
%% lab-1 task-7
A=[3,9,084,7;-7,18,084,2;0,11,084,13;9,6,084,-2]
b=a'
%% lab-1 task-8
b=a'
A(1,:)=b
%% lab-1 task-9
A(end,:)=b
%% lab-1 task-10
linspace(-pi/2,pi/2,15)
linspace(2,5,10)
KHUDA BUX
FL210097
r=rand(1,50)
plot(r)
figure
w=rand(1,50)
plot(w)
Columns 1 through 18
Columns 19 through 36
Columns 37 through 50
y=sum(r);
end
function y=average_of_number(r,n)
y=sum(r)/n;
end
r=rand(1,50);
plot(r)
figure
w=rand(1,50);
plot(w)
%%
n=500
r=rand(1,n);
s=sum_of_numb(r);
a=average_of_number(r,n)
%%
if rand >=0.5
r=1
else
r=0
end
%%
s=rand
if s <0.25
r=0
else
r=2
end
%%
n=10
for i=1:n
s= i*i
end
%%
n=10
for i=1:n
s(i)= i*i
end
%%
r=84;
for Tc=0:10+r:200+r;
Tf=9/5*Tc+32
end
Tf =
32
Tf =
201.2000
Tf =
370.4000
Tf =
539.6000
rn=200;
e=0;
x=5;
for n=0:rn;
e=x^n/factorial(n)+0
end
b=exp(x
KHUDA BUX
FL210097
LAB NO # 03
f=1;
t=0:0.001:10;
A=2;
x1=A*sin(2*pi*f*t);
x2=A*cos(2*pi*f*t);
plot(t,x1)
figure
plot(t,x2)
A=2;
f=1;
n=0:10;
theta=0;
x=A*sin(f*n+theta);
stem(n,x);
%%
f=25;
x=round(rand(1,f));
stem(x)
%%
f=1;
t=0:0.001:10;
A=2;
x=A*exp(-f*t);
plot(t,x)
%%
n=10;
x=round(rand(1,n));
stem(x)
KHUDA BUX
FL210097
LAB NO #06
x=[-3 -1 0 7 2]
h=[-1 0 1]
y=conv(x,h)
subplot (311)
stem(x)
subplot (312)
stem(h)
subplot (313)
stem(y)
untitled2
x =
-3 -1 0 7 2
h =
-1 0 1
y =
3 1 -3 -8 -2 7 2
KHUDA BUX
FL210097
LAB NO #05
close all
clear
clc
%% unit impulse
n=-5:5;
x=zeros(1,numel(n))
x(round(numel(n)/2))=1;
stem(n,x)
xlabel('n')
ylabel('Amplitude')
title('Unit impulse')
x=
Columns 1 through 7
0 0 0 0 0 0 0
Columns 8 through 11
0 0 0 0
%%
n=-5:5;
n0=2;
x=zeros(1,numel(n))
x(round(numel(n)/2)+n0)=1;
stem(n,x)
xlabel('n')
ylabel('Amplitude')
title('Unit impulse')
Columns 1 through 7
0 0 0 0 0 0 0
Columns 8 through 11
0 0 0 0
%%
n=-5:5;
n0=-2;
x=zeros(1,numel(n))
x(round(numel(n)/2)+n0)=1;
stem(n,x)
xlabel('n')
ylabel('Amplitude')
title('Unit impulse')
x=
Columns 1 through 7
0 0 0 0 0 0 0
Columns 8 through 11
0 0 0 0
n=-5:5;
n0=-2;
x=zeros(1,numel(n))
x(round(numel(n)/2):end)=1;
stem(n,x)
xlabel('n')
ylabel('Amplitude')
title('Unit step')
Columns 1 through 7
0 0 0 0 0 0 0
Columns 8 through 11
0 0 0 0
n=-5:5;
n0=-2;
x=zeros(1,numel(n))
x(round(numel(n)/2)+n0:end)=1;
stem(n,x)
xlabel('n')
ylabel('Amplitude')
title('Unit step')
x=
Columns 1 through 7
0 0 0 0 0 0 0
Columns 8 through 11
0 0 0 0
%%
n=-5:5;
x=n;
stem(n,x)
xlabel('n')
ylabel('Amplitude')
title('Unit step')
x=
Columns 1 through 7
0 0 0 0 0 0 0
Columns 8 through 11
0 0 0 0
n=-3:3;
x=0.1.^n;
stem(n,x)
xlabel('n')
ylabel('Amplitude')
title('Unit step')
x=
Columns 1 through 7
0 0 0 0 0 0 0
Columns 8 through 11
0 0 0 0
LAB NO #06
x=[-3 -1 0 7 2]
h=[-1 0 1]
y=conv(x,h)
subplot (311)
stem(x)
subplot (312)
stem(h)
subplot (313)
stem(y)
untitled2
x =
-3 -1 0 7 2
h =
-1 0 1
y =
3 1 -3 -8 -2 7 2
KHUDA BUX
FL 2100097
LAB NO # 12
KHUDA BUX
FL210097