SlideShare a Scribd company logo
1 of 42
Numeric Method Control Lab
Lab Assignment
Submitted by: M.Shahrooz Shahbaz
(2019-ME-37)
Submitted To: Sir Ali Ovais
University of Engineering and Technology,Lahore
Chapter no 1
Question 1
Script
clear, clc
disp('Part (a)')
((14.5^2+6.5^2)/(3.8^2))+55/(sqrt(2)+14)
disp('Part (b)')
(-3.5^3)+(exp(6)/log10(524))+206^1/3
Command window
Question 2
Script
clear, clc
disp('Part (a)')
16.5^2*(8.4-sqrt(70))/(4.3^2-17.3)
disp('Part (b)')
((5.2^3)-((6.4^2)+3)/(1.6^8)-2)+((13.3/5)^1.5)
Command window
Question 3
Script
clear, clc
disp('Part (a)')
15*((sqrt(10)+3.7^2)/(log10(1365)+1.9))
disp('Part (b)')
((2.5^3*(16-216/22))/(1.7^4+14))+2050^1/4
Command window
Question 4
Script
clear, clc
disp('Part (a)')
(2.3^2*1.7)/sqrt((1-0.8^2)^2+(2-sqrt(0.87))^2)
disp('Part (b)')
2.34+(1/2*2.7*(5.9^2-2.4^2))+(9.8*log(51))
Command window
Question 5
Script
clear, clc
disp('Part (a)')
(sin(7*pi/9)/cos(5*pi/7)^2)+1/7*tan(5*pi/12)
disp('Part (b)')
(tand(64)/cosd(14)^2)+(3+sind(80)/0.9^1/3)+(cosd(55)/sind(11))
Command window
Question 6
Script
x=2.34;
% Part a
disp('Part (a)')
2*x^4-6*x^3+14.8*x^2+9.1
% Part b
disp('Part (b)')
exp(2*x)/sqrt(14+x^2-x)
Command window
Question 7
Script
disp('problem7')
t=6.8;
% Part a
log(abs(t^2-t^3))
% Part b
75/(2*t)*cos(0.8*t-3)
Command window
Question no8
Script
x=8.3; y=2.4;
% Part a
disp('Part (a)')
x^2+y^2-x^2/y^2
% Part b
disp('Part (b)')
sqrt(x*y)-sqrt(x+y)+((x-y)/(x-2*y))^2-sqrt(x/y)
Command window
Question no 9
Script
a=13; b=4.2;
c=4*b/a;
d=a*b*c/(a+b+c);
% Part a
disp('Part a')
PartA=a*b/(c+d)+d*a/(c*d)-(a-b^2)*(c+d)
% Part b
disp('Part b')
PartB=sqrt(a^2+b^2)/(d-c)+log(abs(b-a+c-d))
Command window
Chapter no 2
Question no 1
disp('Problem 1')
v1=[3 4*2.55 68/16 45 110^(1/3) cosd(25) 0.05]
Command window
Problem 1
v1 =
3.0000 10.2000 4.2500 45.0000 4.7914 0.9063 0.0500
Question no 2
disp('Problem 2')
v2=[54/(3+4.2^2), 32, 6.3^2-7.2^2, 54, exp(3.7),sind(66)+cos(3*pi/8)]
Problem 2
v2 =
2.6163 32.0000 -12.1500 54.0000 40.4473 1.2962
Question no 3
disp('Problem 3')
v3=[25.5 14*tand(58)/(2.1^2+11) factorial(6) 2.7^4 0.0375,pi/5]
Command window
Problem 3
v3 =
25.5000 1.4539 720.0000 53.1441 0.0375 0.6283
Question no 4
disp('Problem 4')
v4=[32/3.2^2; sind(35)^2; 6.1; log(29^2); 0.00552;
log(29)^2; 133]
Command window
Problem 4
v4 =
3.1250
0.3290
6.1000
6.7346
0.0055
11.3387
133.0000
Question no 5
disp('Problem 5')
x=0.85; y=12.5;
v5=[y; y^x; log(y/x); y*x; x+y]
Command window
Problem 5
v5 =
12.5000
8.5580
2.6882
10.6250
13.3500
Question no 6
disp('Problem 6')
a=3.5; b=-6.4;
v6=[a a^2 a/b a*b sqrt(a)]
Command window
Problem 6
v6 =
3.5000 12.2500 -0.5469 -22.4000 1.8708
Question no 7
disp('Problem 7')
v7=2:5:37
Command window
Problem 7
v7 =
2 7 12 17 22 27 32 37
Question no 8
disp('Problem 8')
v8=linspace(81,12,9)
Command window
Problem 8
v8 =
81.0000 72.3750 63.7500 55.1250 46.5000 37.8750 29.2500 20.6250
12.0000
Question no 9
disp('Problem 9')
v9=[22.5:-2.5:0]'
Command window
Problem 9
v9 =
22.5000
20.0000
17.5000
15.0000
12.5000
10.0000
7.5000
5.0000
2.5000
0
Question no 10
disp('Problem 10')
v10=linspace(-21,12,15)'
Command window
Problem 10
v10 =
-21.0000
-18.6429
-16.2857
-13.9286
-11.5714
-9.2143
-6.8571
-4.5000
-2.1429
0.2143
2.5714
4.9286
7.2857
9.6429
12.0000
Question no 11
disp('Problem 11')
same(1:7)=-3
Command window
Problem 11
same =
-3 -3 -3 -3 -3 -3 -3
Question no 12
disp('Problem 12')
a(9)=7.5
Command window
Problem 12
a =
3.5000 0 0 0 0 0 0 0 7.5000
Question no 13
disp('Problem 13')
b=[1:10 9:-1:1]
Command window
Problem 13
b =
Columns 1 through 17
1 2 3 4 5 6 7 8 9 10 9 8 7 6 5 4 3
Columns 18 through 19
2 1
Question no 21
disp('Problem 21')
E(2:4,3:5)=[1:3;4:6;7:9]
Command window
Problem 21
E =
0 0 0 0 0
0 0 1 2 3
0 0 4 5 6
0 0 7 8 9
Question no 22
disp('Problem 22')
F(2:4,3:5)=[1:3;10:-2:6;20:6:32]'
Command window
Problem 22
F =
0 0 0 0 0
0 0 1 10 20
0 0 2 8 26
0 0 3 6 32
Question no 23
disp('Problem 23')
a=[7 2 -3 1 0];
b=[-3 10 0 7 -2];
c=[1 0 4 -6 5];
ma=[a;b;c]
mb=[a' b' c']
Command window
Problem 23
ma =
7 2 -3 1 0
-3 10 0 7 -2
1 0 4 -6 5
mb =
7 -3 1
2 10 0
-3 0 4
1 7 -6
0 -2 5
Question no 29
disp('Problem 29')
A=[1:6;7:12;13:18]
ha=A(1,:)
hb=A(:,6)'
hc=[A(2,1:3) A(3,4:6)]
Command window
Problem 29
A =
1 2 3 4 5 6
7 8 9 10 11 12
13 14 15 16 17 18
ha =
1 2 3 4 5 6
hb =
6 12 18
hc =
7 8 9 16 17 18
Question no 30
disp('Problem 30')
B=[18:-1:13;12:-1:7;6:-1:1]
va=[B(:,2)' B(:,5)']
vb=[B(3,3:6) B(:,2)']'
vc=[B(:,2)' B(:,4)' B(:,6)']'
Command window
Problem 30
B =
18 17 16 15 14 13
12 11 10 9 8 7
6 5 4 3 2 1
va =
17 11 5 14 8 2
vb =
4
3
2
1
17
11
5
vc =
17
11
5
15
9
3
13
7
1
Question no 31
disp('Problem 31')
C=0.7:1.2:17.5
D=reshape(C,5,3)'
ua=[D(:,1)' D(:,3)' D(:,4)']'
ub=[D(2,:) D(:,3)']
uc=[D(1,1:3) D(3,3:5)]
Command window
Problem 31
C =
Columns 1 through 10
0.7000 1.9000 3.1000 4.3000 5.5000 6.7000 7.9000 9.1000 10.3000
11.5000
Columns 11 through 15
12.7000 13.9000 15.1000 16.3000 17.5000
D =
0.7000 1.9000 3.1000 4.3000 5.5000
6.7000 7.9000 9.1000 10.3000 11.5000
12.7000 13.9000 15.1000 16.3000 17.5000
ua =
0.7000
6.7000
12.7000
3.1000
9.1000
15.1000
4.3000
10.3000
16.3000
ub =
6.7000 7.9000 9.1000 10.3000 11.5000 3.1000 9.1000 15.1000
uc =
0.7000 1.9000 3.1000 15.1000 16.3000 17.5000
Question no 32
disp('Problem 32')
a(5:7)=2;
E=[a;0.7:-0.1:0.1;2:2:14;22:-3:4]
F=E([2 4],3:7)
G=E(:,3:5)
Command window
Problem 32
E =
7.0000 2.0000 -3.0000 1.0000 2.0000 2.0000 2.0000
0.7000 0.6000 0.5000 0.4000 0.3000 0.2000 0.1000
2.0000 4.0000 6.0000 8.0000 10.0000 12.0000 14.0000
22.0000 19.0000 16.0000 13.0000 10.0000 7.0000 4.0000
F =
0.5000 0.4000 0.3000 0.2000 0.1000
16.0000 13.0000 10.0000 7.0000 4.0000
G =
-3.0000 1.0000 2.0000
0.5000 0.4000 0.3000
6.0000 8.0000 10.0000
16.0000 13.0000 10.0000
Question no 38
disp('Problem 38')
A=[eye(2) zeros(2,1) ones(2)]
B=[zeros(2) ones(2); zeros(1,4); ones(1,4)]
C=[ones(4,2),zeros(4,2),[ones(1) zeros(1,3)]']
Command window
Problem 38
A =
1 0 0 1 1
0 1 0 1 1
B =
0 0 1 1
0 0 1 1
0 0 0 0
1 1 1 1
C =
1 1 0 0 1
1 1 0 0 0
1 1 0 0 0
1 1 0 0 0
Question no 39
disp('Problem 39')
A=eye(6)
A(1:3,4:6)=eye(3)
A(4:6,1:3)=eye(3)
Command window
Problem 39
A =
1 0 0 0 0 0
0 1 0 0 0 0
0 0 1 0 0 0
0 0 0 1 0 0
0 0 0 0 1 0
0 0 0 0 0 1
A =
1 0 0 1 0 0
0 1 0 0 1 0
0 0 1 0 0 1
0 0 0 1 0 0
0 0 0 0 1 0
0 0 0 0 0 1
A =
1 0 0 1 0 0
0 1 0 0 1 0
0 0 1 0 0 1
1 0 0 1 0 0
0 1 0 0 1 0
0 0 1 0 0 1
Question no 40
disp('Problem 40')
A=ones(2)
A(3:4,3:4)=A
A=[A A]
Command window
Problem 40
A =
1 1
1 1
A =
1 1 0 0
1 1 0 0
0 0 1 1
0 0 1 1
A =
1 1 0 0 1 1 0 0
1 1 0 0 1 1 0 0
0 0 1 1 0 0 1 1
0 0 1 1 0 0 1 1
Chapter 3
Question no 1
disp('Problem 1')
x=-2:4
Command window
Problem 1
x =
-2 -1 0 1 2 3 4
Question no 2
disp('Problem 2')
x=-3:3
y=(x.^2-2)./(x+4)
Command window
Problem 2
x =
-3 -2 -1 0 1 2 3
y =
7.0000 1.0000 -0.3333 -0.5000 -0.2000 0.3333 1.0000
Question no 3
disp('Problem 3')
x=1:7
y=(x-3).*(x.^2+3)./x.^2
Command window
Problem 3
x =
1 2 3 4 5 6 7
y =
-8.0000 -1.7500 0 1.1875 2.2400 3.2500 4.2449
Question no 4
disp('Problem 4')
t=0:8
y=20*t.^(2/3)./(t+1)-(t+1).^2./exp(0.3*t+5)+2./(t+1)
Command window
Problem 4
t =
0 1 2 3 4 5 6 7 8
y =
1.9933 10.9800 11.2161 10.8566 10.4286 10.0259 9.6652 9.3455
9.0616
Question no 10
disp('Problem 10')
v=[3 -2 4];
u=[5 3 -1];
v.*u
v*u'
v'*u
Command window
Problem 10
ans =
15 -6 -4
ans =
5
ans =
15 9 -3
-10 -6 2
20 12 -4
Question no 11
disp('Problem 11')
va=[6.5 -5 -4];
ua=[-3 8 -2];
dotuva=sum(u.*v)
ub=[-3 8 -2];
vb=[6.5; -5; -4];
ub*vb
vc=[6.5 -5 -4];
uc=[-3 8 -2];
dotuvc=dot(vc,uc)
Command window
Problem 11
dotuva =
5
ans =
-51.5000
dotuvc =
-51.5000
Question no 12
disp('Problem 12')
v=2:2:10
a=1./v
b=1./v.^2
c=v/2
d=v./v
Command window
Problem 12
v =
2 4 6 8 10
a =
0.5000 0.2500 0.1667 0.1250 0.1000
b =
0.2500 0.0625 0.0278 0.0156 0.0100
c =
1 2 3 4 5
d =
1 1 1 1 1
Question no 13
disp('Problem 13')
v=5:-1:1
a=v.^2
b=v.^v
c=v*5
d=v-1
Command window
Problem 13
v =
5 4 3 2 1
a =
25 16 9 4 1
b =
3125 256 27 4 1
c =
25 20 15 10 5
d =
4 3 2 1 0
Question no 14
disp('Problem 14')
x=1:2:9;
y=2:3:14;
disp('Parta')
za=x.*y.^2./(x+y)
disp('Partb')
zb=x.*(x.^2-y)-(x-y).^2
Command window
Problem 14
Part a
za =
1.3333 9.3750 24.6154 47.0556 76.6957
Part b
zb =
-2 8 76 250 578
Question no 23
disp('Problem 23')
na = 1:10;
ya = 1./2.^na;
disp('Parta')
Sa = sum(ya)
aPercentError=abs(1-Sa)*100
nb = 1:20;
yb = 1./2.^nb;
disp('Partb')
Sb = sum(yb)
bPercentError=abs(1-Sb)*100
nc = 1:30;
yc = 1./2.^nc;
disp('Partc')
Sc = sum(yc)
cPercentError=abs(1-Sc)*100
nd = 1:40;
yd = 1./2.^nb;
disp('Partd')
Sd = sum(yd)
dPercentError=abs(1-Sc)*100
Command window
Problem 23
Part a
Sa =
0.9990
aPercentError =
0.0977
Part b
Sb =
1.0000
bPercentError =
9.5367e-05
Part c
Sc =
1.0000
cPercentError =
9.3132e-08
Part d
Sd =
1.0000
dPercentError =
9.3132e-08
Problem 14
Part a
za =
1.3333 9.3750 24.6154 47.0556 76.6957
Part b
zb =
-2 8 76 250 578
Command window
Problem 23
Part a
Sa =
0.9990
aPercentError =
0.0977
Part b
Sb =
1.0000
bPercentError =
9.5367e-05
Part c
Sc =
1.0000
cPercentError =
9.3132e-08
Part d
Sd =
1.0000
dPercentError =
9.3132e-08
Question no 24
disp('Problem 24')
clear,clc
na = 0:10;
ya = (-3).^(-na)./(2*na+1);
disp('Parta')
Sa = sqrt(12)*sum(ya)
aPercentError=abs((pi-Sa)/pi)*100
nb = 0:20;
yb = (-3).^(-nb)./(2*nb+1);
disp('Partb')
Sb = sqrt(12)*sum(yb)
bPercentError=abs((pi-Sb)/pi)*100
nc = 0:30;
yc = (-3).^(-nc)./(2*nc+1);
disp('Partc')
Sc = sqrt(12)*sum(yc)
cPercentError=abs((pi-Sc)/pi)*100
Command window
Part a
Sa =
3.1416
aPercentError =
2.0719e-05
Part b
Sb =
3.1416
bPercentError =
1.8596e-10
Part c
Sc =
3.1416
cPercentError =
2.8272e-14
Question no 32
disp('Problem 32')
A=[3 1.5 1 0.5 4; -2 1 4 -3.5 2; 6 -3 2 2.5 1; 1 4 -3 0.5 -2; 3 2 -1 1.5 -3];
C=[-11.75; 19; -23; -1.5; -3.5];
x=AC
Problem 32
x =
-4.0000
2.5000
4.0000
1.0000
-2.0000
Chapter 5
Problem 1
Script
disp('Problem 1')
x=linspace(-3,5,200);
y=(x+5).^2./(4+3*x.^2);
plot(x,y)
xlabel('x')
ylabel('y')
Commandwindow
Problem 2
Script
disp('Problem 2')
fplot('5*sin(x)/(x+exp(-0.75*x))',[-5 10])
xlabel('x')
ylabel('y')
Commandwindow
Problem 3
Script
disp('Problem 3')
x1=linspace(0,3,200);
y1=(x1+1).*(x1-2).*(2*x1-0.25)-exp(x1);
x2=linspace(-3,6,200);
y2=(x2+1).*(x2-2).*(2*x2-0.25)-exp(x2);
plot(x1,y1)
xlabel('x')
ylabel('y')
Commandwindow
Problem 4
Script
disp('Problem 4')
plot('sqrt(abs(cos(3*x)))+sin(4*x)^2',[-2 2])
xlabel('x')
ylabel('y'))
Commandwindow
Problem 5
Script
disp('Problem 5')
fplot('exp(2*sin(0.4*x))*5*cos(4*x)',[-20 30])
xlabel('x')
ylabel('y')
Commandwindow
Problem 6
Script
disp('Problem 6')
t=linspace(0,2*pi,100);
x=1.5*sin(5*t);
y=1.5*cos(3*t);
plot(x,y)
axis([-2 2 -2 2])
xlabel('x')
ylabel('y')
Commandwindow
Problem 8
Script
disp('Problem 8')
t1=linspace(-30,-1.6,500);
t2=linspace(-0.6,40,500);
x1=3*t1./(1+t1.^3);
y1=3*t1.^2./(1+t1.^3);
x2=3*t2./(1+t2.^3);
y2=3*t2.^2./(1+t2.^3);
plot(x1,y1,x2,y2)
xlabel('x')
ylabel('y')
Commandwindow
2019-ME-37(NMC).docx

More Related Content

What's hot

Solution Manual : Chapter - 06 Application of the Definite Integral in Geomet...
Solution Manual : Chapter - 06 Application of the Definite Integral in Geomet...Solution Manual : Chapter - 06 Application of the Definite Integral in Geomet...
Solution Manual : Chapter - 06 Application of the Definite Integral in Geomet...Hareem Aslam
 
Numerical Algorithm for a few Special Functions
Numerical Algorithm for a few Special FunctionsNumerical Algorithm for a few Special Functions
Numerical Algorithm for a few Special FunctionsAmos Tsai
 
Trial terengganu 2014 spm add math k2 skema
Trial terengganu 2014 spm add math k2 skemaTrial terengganu 2014 spm add math k2 skema
Trial terengganu 2014 spm add math k2 skemaCikgu Pejal
 
Solution Manual : Chapter - 01 Functions
Solution Manual : Chapter - 01 FunctionsSolution Manual : Chapter - 01 Functions
Solution Manual : Chapter - 01 FunctionsHareem Aslam
 
College algebra Assignment
College algebra AssignmentCollege algebra Assignment
College algebra AssignmentDenni Domingo
 
Hand book of Howard Anton calculus exercises 8th edition
Hand book of Howard Anton calculus exercises 8th editionHand book of Howard Anton calculus exercises 8th edition
Hand book of Howard Anton calculus exercises 8th editionPriSim
 
Solutions manual for calculus an applied approach brief international metric ...
Solutions manual for calculus an applied approach brief international metric ...Solutions manual for calculus an applied approach brief international metric ...
Solutions manual for calculus an applied approach brief international metric ...Larson612
 
Potencias y radicales resueltos 1-5
Potencias y radicales resueltos 1-5Potencias y radicales resueltos 1-5
Potencias y radicales resueltos 1-5Educación
 
Solution Manual : Chapter - 07 Exponential, Logarithmic and Inverse Trigonome...
Solution Manual : Chapter - 07 Exponential, Logarithmic and Inverse Trigonome...Solution Manual : Chapter - 07 Exponential, Logarithmic and Inverse Trigonome...
Solution Manual : Chapter - 07 Exponential, Logarithmic and Inverse Trigonome...Hareem Aslam
 
Arna Friend Controls II Final
Arna Friend Controls II FinalArna Friend Controls II Final
Arna Friend Controls II FinalArna Friend
 
Trial pahang 2014 spm add math k2 dan skema [scan]
Trial pahang 2014 spm add math k2 dan skema [scan]Trial pahang 2014 spm add math k2 dan skema [scan]
Trial pahang 2014 spm add math k2 dan skema [scan]Cikgu Pejal
 
T.I.M.E. JEE Advanced 2013 Solution Paper1
T.I.M.E. JEE Advanced 2013 Solution Paper1T.I.M.E. JEE Advanced 2013 Solution Paper1
T.I.M.E. JEE Advanced 2013 Solution Paper1askiitians
 
7 วิชา คณิต the brain
7 วิชา คณิต   the brain7 วิชา คณิต   the brain
7 วิชา คณิต the brainJamescoolboy
 

What's hot (18)

008 math a-net
008 math a-net008 math a-net
008 math a-net
 
Solution Manual : Chapter - 06 Application of the Definite Integral in Geomet...
Solution Manual : Chapter - 06 Application of the Definite Integral in Geomet...Solution Manual : Chapter - 06 Application of the Definite Integral in Geomet...
Solution Manual : Chapter - 06 Application of the Definite Integral in Geomet...
 
Integral table
Integral tableIntegral table
Integral table
 
Numerical Algorithm for a few Special Functions
Numerical Algorithm for a few Special FunctionsNumerical Algorithm for a few Special Functions
Numerical Algorithm for a few Special Functions
 
Trial terengganu 2014 spm add math k2 skema
Trial terengganu 2014 spm add math k2 skemaTrial terengganu 2014 spm add math k2 skema
Trial terengganu 2014 spm add math k2 skema
 
Solution Manual : Chapter - 01 Functions
Solution Manual : Chapter - 01 FunctionsSolution Manual : Chapter - 01 Functions
Solution Manual : Chapter - 01 Functions
 
College algebra Assignment
College algebra AssignmentCollege algebra Assignment
College algebra Assignment
 
Hand book of Howard Anton calculus exercises 8th edition
Hand book of Howard Anton calculus exercises 8th editionHand book of Howard Anton calculus exercises 8th edition
Hand book of Howard Anton calculus exercises 8th edition
 
Solutions manual for calculus an applied approach brief international metric ...
Solutions manual for calculus an applied approach brief international metric ...Solutions manual for calculus an applied approach brief international metric ...
Solutions manual for calculus an applied approach brief international metric ...
 
Clase 15 dsp
Clase 15 dspClase 15 dsp
Clase 15 dsp
 
Potencias y radicales resueltos 1-5
Potencias y radicales resueltos 1-5Potencias y radicales resueltos 1-5
Potencias y radicales resueltos 1-5
 
Solution Manual : Chapter - 07 Exponential, Logarithmic and Inverse Trigonome...
Solution Manual : Chapter - 07 Exponential, Logarithmic and Inverse Trigonome...Solution Manual : Chapter - 07 Exponential, Logarithmic and Inverse Trigonome...
Solution Manual : Chapter - 07 Exponential, Logarithmic and Inverse Trigonome...
 
Clase 16 dsp
Clase 16 dspClase 16 dsp
Clase 16 dsp
 
Arna Friend Controls II Final
Arna Friend Controls II FinalArna Friend Controls II Final
Arna Friend Controls II Final
 
V2.0
V2.0V2.0
V2.0
 
Trial pahang 2014 spm add math k2 dan skema [scan]
Trial pahang 2014 spm add math k2 dan skema [scan]Trial pahang 2014 spm add math k2 dan skema [scan]
Trial pahang 2014 spm add math k2 dan skema [scan]
 
T.I.M.E. JEE Advanced 2013 Solution Paper1
T.I.M.E. JEE Advanced 2013 Solution Paper1T.I.M.E. JEE Advanced 2013 Solution Paper1
T.I.M.E. JEE Advanced 2013 Solution Paper1
 
7 วิชา คณิต the brain
7 วิชา คณิต   the brain7 วิชา คณิต   the brain
7 วิชา คณิต the brain
 

Similar to 2019-ME-37(NMC).docx

Solution of matlab chapter 6
Solution of matlab chapter 6Solution of matlab chapter 6
Solution of matlab chapter 6AhsanIrshad8
 
Solutions_Manual_to_accompany_Applied_Nu.pdf
Solutions_Manual_to_accompany_Applied_Nu.pdfSolutions_Manual_to_accompany_Applied_Nu.pdf
Solutions_Manual_to_accompany_Applied_Nu.pdfWaleedHussain30
 
Questions on Verbal & Non Verbal Reasoning
Questions on Verbal & Non Verbal ReasoningQuestions on Verbal & Non Verbal Reasoning
Questions on Verbal & Non Verbal ReasoningLearnPick
 
Question 1 of 205.0 PointsSolve the following radical equation .docx
Question 1 of 205.0 PointsSolve the following radical equation .docxQuestion 1 of 205.0 PointsSolve the following radical equation .docx
Question 1 of 205.0 PointsSolve the following radical equation .docxteofilapeerless
 
Solution of matlab chapter 3
Solution of matlab chapter 3Solution of matlab chapter 3
Solution of matlab chapter 3AhsanIrshad8
 
Group Cycloid Factoring
Group Cycloid FactoringGroup Cycloid Factoring
Group Cycloid FactoringCycloid 3
 
Mathematical Modelling of Electrical/Mechanical modellinng in MATLAB
Mathematical Modelling of Electrical/Mechanical modellinng in MATLABMathematical Modelling of Electrical/Mechanical modellinng in MATLAB
Mathematical Modelling of Electrical/Mechanical modellinng in MATLABCOMSATS Abbottabad
 
Ncert solutions for class 7 maths chapter 1 integers exercise 1.4
Ncert solutions for class 7 maths chapter 1 integers exercise 1.4Ncert solutions for class 7 maths chapter 1 integers exercise 1.4
Ncert solutions for class 7 maths chapter 1 integers exercise 1.4iprepkumar
 
1 fichas refuerzo operaciones combinadas numeros
1 fichas refuerzo operaciones combinadas numeros1 fichas refuerzo operaciones combinadas numeros
1 fichas refuerzo operaciones combinadas numerosBea Marfer
 
Solution of matlab chapter 2
Solution of matlab chapter 2Solution of matlab chapter 2
Solution of matlab chapter 2AhsanIrshad8
 
WINSEM2020-21_STS3105_SS_VL2020210500169_Reference_Material_I_01-Mar-2021_L12...
WINSEM2020-21_STS3105_SS_VL2020210500169_Reference_Material_I_01-Mar-2021_L12...WINSEM2020-21_STS3105_SS_VL2020210500169_Reference_Material_I_01-Mar-2021_L12...
WINSEM2020-21_STS3105_SS_VL2020210500169_Reference_Material_I_01-Mar-2021_L12...MaruMengesha
 
William hyatt-7th-edition-drill-problems-solution
William hyatt-7th-edition-drill-problems-solutionWilliam hyatt-7th-edition-drill-problems-solution
William hyatt-7th-edition-drill-problems-solutionSalman Salman
 
Kuncisoal mtk-un-smk-prwsta
Kuncisoal mtk-un-smk-prwstaKuncisoal mtk-un-smk-prwsta
Kuncisoal mtk-un-smk-prwstamardiyanto83
 

Similar to 2019-ME-37(NMC).docx (20)

Solution of matlab chapter 6
Solution of matlab chapter 6Solution of matlab chapter 6
Solution of matlab chapter 6
 
Solucionario c.t. álgebra 5°
Solucionario c.t.   álgebra 5°Solucionario c.t.   álgebra 5°
Solucionario c.t. álgebra 5°
 
Indices
IndicesIndices
Indices
 
Solutions_Manual_to_accompany_Applied_Nu.pdf
Solutions_Manual_to_accompany_Applied_Nu.pdfSolutions_Manual_to_accompany_Applied_Nu.pdf
Solutions_Manual_to_accompany_Applied_Nu.pdf
 
Questions on Verbal & Non Verbal Reasoning
Questions on Verbal & Non Verbal ReasoningQuestions on Verbal & Non Verbal Reasoning
Questions on Verbal & Non Verbal Reasoning
 
Question 1 of 205.0 PointsSolve the following radical equation .docx
Question 1 of 205.0 PointsSolve the following radical equation .docxQuestion 1 of 205.0 PointsSolve the following radical equation .docx
Question 1 of 205.0 PointsSolve the following radical equation .docx
 
Solution of matlab chapter 3
Solution of matlab chapter 3Solution of matlab chapter 3
Solution of matlab chapter 3
 
Group Cycloid Factoring
Group Cycloid FactoringGroup Cycloid Factoring
Group Cycloid Factoring
 
Mathematical Modelling of Electrical/Mechanical modellinng in MATLAB
Mathematical Modelling of Electrical/Mechanical modellinng in MATLABMathematical Modelling of Electrical/Mechanical modellinng in MATLAB
Mathematical Modelling of Electrical/Mechanical modellinng in MATLAB
 
Ncert solutions for class 7 maths chapter 1 integers exercise 1.4
Ncert solutions for class 7 maths chapter 1 integers exercise 1.4Ncert solutions for class 7 maths chapter 1 integers exercise 1.4
Ncert solutions for class 7 maths chapter 1 integers exercise 1.4
 
Matlab quick quide3.4
Matlab  quick quide3.4Matlab  quick quide3.4
Matlab quick quide3.4
 
1 fichas refuerzo operaciones combinadas numeros
1 fichas refuerzo operaciones combinadas numeros1 fichas refuerzo operaciones combinadas numeros
1 fichas refuerzo operaciones combinadas numeros
 
Solution of matlab chapter 2
Solution of matlab chapter 2Solution of matlab chapter 2
Solution of matlab chapter 2
 
WINSEM2020-21_STS3105_SS_VL2020210500169_Reference_Material_I_01-Mar-2021_L12...
WINSEM2020-21_STS3105_SS_VL2020210500169_Reference_Material_I_01-Mar-2021_L12...WINSEM2020-21_STS3105_SS_VL2020210500169_Reference_Material_I_01-Mar-2021_L12...
WINSEM2020-21_STS3105_SS_VL2020210500169_Reference_Material_I_01-Mar-2021_L12...
 
Chapter001
Chapter001Chapter001
Chapter001
 
William hyatt-7th-edition-drill-problems-solution
William hyatt-7th-edition-drill-problems-solutionWilliam hyatt-7th-edition-drill-problems-solution
William hyatt-7th-edition-drill-problems-solution
 
Ae11 sol
Ae11 solAe11 sol
Ae11 sol
 
Kuncisoal mtk-un-smk-prwsta
Kuncisoal mtk-un-smk-prwstaKuncisoal mtk-un-smk-prwsta
Kuncisoal mtk-un-smk-prwsta
 
Testsol
TestsolTestsol
Testsol
 
Trig packet1 000
Trig packet1 000Trig packet1 000
Trig packet1 000
 

Recently uploaded

VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130Suhani Kapoor
 
HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2RajaP95
 
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfCCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfAsst.prof M.Gokilavani
 
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...VICTOR MAESTRE RAMIREZ
 
Artificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptxArtificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptxbritheesh05
 
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝soniya singh
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile servicerehmti665
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130Suhani Kapoor
 
chaitra-1.pptx fake news detection using machine learning
chaitra-1.pptx  fake news detection using machine learningchaitra-1.pptx  fake news detection using machine learning
chaitra-1.pptx fake news detection using machine learningmisbanausheenparvam
 
Call Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call GirlsCall Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call Girlsssuser7cb4ff
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVRajaP95
 
Heart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxHeart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxPoojaBan
 
Internship report on mechanical engineering
Internship report on mechanical engineeringInternship report on mechanical engineering
Internship report on mechanical engineeringmalavadedarshan25
 
main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidNikhilNagaraju
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxwendy cai
 
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...srsj9000
 
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionSachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionDr.Costas Sachpazis
 

Recently uploaded (20)

VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
 
HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2
 
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfCCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
 
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
 
Artificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptxArtificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptx
 
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile service
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
 
chaitra-1.pptx fake news detection using machine learning
chaitra-1.pptx  fake news detection using machine learningchaitra-1.pptx  fake news detection using machine learning
chaitra-1.pptx fake news detection using machine learning
 
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
 
Call Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call GirlsCall Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call Girls
 
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Serviceyoung call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
 
Heart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxHeart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptx
 
Internship report on mechanical engineering
Internship report on mechanical engineeringInternship report on mechanical engineering
Internship report on mechanical engineering
 
main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfid
 
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptxExploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptx
 
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
 
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionSachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
 

2019-ME-37(NMC).docx

  • 1. Numeric Method Control Lab Lab Assignment Submitted by: M.Shahrooz Shahbaz (2019-ME-37) Submitted To: Sir Ali Ovais University of Engineering and Technology,Lahore
  • 2. Chapter no 1 Question 1 Script clear, clc disp('Part (a)') ((14.5^2+6.5^2)/(3.8^2))+55/(sqrt(2)+14) disp('Part (b)') (-3.5^3)+(exp(6)/log10(524))+206^1/3 Command window Question 2 Script clear, clc disp('Part (a)') 16.5^2*(8.4-sqrt(70))/(4.3^2-17.3) disp('Part (b)') ((5.2^3)-((6.4^2)+3)/(1.6^8)-2)+((13.3/5)^1.5) Command window Question 3 Script clear, clc disp('Part (a)')
  • 3. 15*((sqrt(10)+3.7^2)/(log10(1365)+1.9)) disp('Part (b)') ((2.5^3*(16-216/22))/(1.7^4+14))+2050^1/4 Command window Question 4 Script clear, clc disp('Part (a)') (2.3^2*1.7)/sqrt((1-0.8^2)^2+(2-sqrt(0.87))^2) disp('Part (b)') 2.34+(1/2*2.7*(5.9^2-2.4^2))+(9.8*log(51)) Command window Question 5 Script clear, clc disp('Part (a)') (sin(7*pi/9)/cos(5*pi/7)^2)+1/7*tan(5*pi/12) disp('Part (b)') (tand(64)/cosd(14)^2)+(3+sind(80)/0.9^1/3)+(cosd(55)/sind(11)) Command window
  • 4. Question 6 Script x=2.34; % Part a disp('Part (a)') 2*x^4-6*x^3+14.8*x^2+9.1 % Part b disp('Part (b)') exp(2*x)/sqrt(14+x^2-x) Command window Question 7 Script disp('problem7') t=6.8; % Part a log(abs(t^2-t^3)) % Part b
  • 5. 75/(2*t)*cos(0.8*t-3) Command window Question no8 Script x=8.3; y=2.4; % Part a disp('Part (a)') x^2+y^2-x^2/y^2 % Part b disp('Part (b)') sqrt(x*y)-sqrt(x+y)+((x-y)/(x-2*y))^2-sqrt(x/y) Command window Question no 9 Script a=13; b=4.2; c=4*b/a; d=a*b*c/(a+b+c); % Part a disp('Part a')
  • 6. PartA=a*b/(c+d)+d*a/(c*d)-(a-b^2)*(c+d) % Part b disp('Part b') PartB=sqrt(a^2+b^2)/(d-c)+log(abs(b-a+c-d)) Command window Chapter no 2 Question no 1 disp('Problem 1') v1=[3 4*2.55 68/16 45 110^(1/3) cosd(25) 0.05] Command window Problem 1 v1 = 3.0000 10.2000 4.2500 45.0000 4.7914 0.9063 0.0500 Question no 2 disp('Problem 2') v2=[54/(3+4.2^2), 32, 6.3^2-7.2^2, 54, exp(3.7),sind(66)+cos(3*pi/8)] Problem 2 v2 = 2.6163 32.0000 -12.1500 54.0000 40.4473 1.2962
  • 7. Question no 3 disp('Problem 3') v3=[25.5 14*tand(58)/(2.1^2+11) factorial(6) 2.7^4 0.0375,pi/5] Command window Problem 3 v3 = 25.5000 1.4539 720.0000 53.1441 0.0375 0.6283 Question no 4 disp('Problem 4') v4=[32/3.2^2; sind(35)^2; 6.1; log(29^2); 0.00552; log(29)^2; 133] Command window Problem 4 v4 = 3.1250 0.3290 6.1000 6.7346 0.0055 11.3387 133.0000
  • 8. Question no 5 disp('Problem 5') x=0.85; y=12.5; v5=[y; y^x; log(y/x); y*x; x+y] Command window Problem 5 v5 = 12.5000 8.5580 2.6882 10.6250 13.3500 Question no 6 disp('Problem 6') a=3.5; b=-6.4; v6=[a a^2 a/b a*b sqrt(a)] Command window Problem 6 v6 = 3.5000 12.2500 -0.5469 -22.4000 1.8708 Question no 7 disp('Problem 7') v7=2:5:37 Command window
  • 9. Problem 7 v7 = 2 7 12 17 22 27 32 37 Question no 8 disp('Problem 8') v8=linspace(81,12,9) Command window Problem 8 v8 = 81.0000 72.3750 63.7500 55.1250 46.5000 37.8750 29.2500 20.6250 12.0000 Question no 9 disp('Problem 9') v9=[22.5:-2.5:0]' Command window Problem 9 v9 = 22.5000 20.0000 17.5000
  • 10. 15.0000 12.5000 10.0000 7.5000 5.0000 2.5000 0 Question no 10 disp('Problem 10') v10=linspace(-21,12,15)' Command window Problem 10 v10 = -21.0000 -18.6429 -16.2857 -13.9286 -11.5714 -9.2143 -6.8571 -4.5000 -2.1429 0.2143 2.5714 4.9286 7.2857 9.6429 12.0000
  • 11. Question no 11 disp('Problem 11') same(1:7)=-3 Command window Problem 11 same = -3 -3 -3 -3 -3 -3 -3 Question no 12 disp('Problem 12') a(9)=7.5 Command window Problem 12 a = 3.5000 0 0 0 0 0 0 0 7.5000 Question no 13 disp('Problem 13') b=[1:10 9:-1:1] Command window Problem 13 b = Columns 1 through 17
  • 12. 1 2 3 4 5 6 7 8 9 10 9 8 7 6 5 4 3 Columns 18 through 19 2 1 Question no 21 disp('Problem 21') E(2:4,3:5)=[1:3;4:6;7:9] Command window Problem 21 E = 0 0 0 0 0 0 0 1 2 3 0 0 4 5 6 0 0 7 8 9 Question no 22 disp('Problem 22') F(2:4,3:5)=[1:3;10:-2:6;20:6:32]' Command window Problem 22 F = 0 0 0 0 0 0 0 1 10 20
  • 13. 0 0 2 8 26 0 0 3 6 32 Question no 23 disp('Problem 23') a=[7 2 -3 1 0]; b=[-3 10 0 7 -2]; c=[1 0 4 -6 5]; ma=[a;b;c] mb=[a' b' c'] Command window Problem 23 ma = 7 2 -3 1 0 -3 10 0 7 -2 1 0 4 -6 5 mb = 7 -3 1 2 10 0 -3 0 4 1 7 -6 0 -2 5 Question no 29 disp('Problem 29') A=[1:6;7:12;13:18]
  • 14. ha=A(1,:) hb=A(:,6)' hc=[A(2,1:3) A(3,4:6)] Command window Problem 29 A = 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 ha = 1 2 3 4 5 6 hb = 6 12 18 hc = 7 8 9 16 17 18 Question no 30 disp('Problem 30') B=[18:-1:13;12:-1:7;6:-1:1] va=[B(:,2)' B(:,5)'] vb=[B(3,3:6) B(:,2)']'
  • 15. vc=[B(:,2)' B(:,4)' B(:,6)']' Command window Problem 30 B = 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 va = 17 11 5 14 8 2 vb = 4 3 2 1 17 11 5 vc = 17 11 5 15 9
  • 16. 3 13 7 1 Question no 31 disp('Problem 31') C=0.7:1.2:17.5 D=reshape(C,5,3)' ua=[D(:,1)' D(:,3)' D(:,4)']' ub=[D(2,:) D(:,3)'] uc=[D(1,1:3) D(3,3:5)] Command window Problem 31 C = Columns 1 through 10 0.7000 1.9000 3.1000 4.3000 5.5000 6.7000 7.9000 9.1000 10.3000 11.5000 Columns 11 through 15 12.7000 13.9000 15.1000 16.3000 17.5000 D = 0.7000 1.9000 3.1000 4.3000 5.5000 6.7000 7.9000 9.1000 10.3000 11.5000 12.7000 13.9000 15.1000 16.3000 17.5000
  • 17. ua = 0.7000 6.7000 12.7000 3.1000 9.1000 15.1000 4.3000 10.3000 16.3000 ub = 6.7000 7.9000 9.1000 10.3000 11.5000 3.1000 9.1000 15.1000 uc = 0.7000 1.9000 3.1000 15.1000 16.3000 17.5000 Question no 32 disp('Problem 32') a(5:7)=2; E=[a;0.7:-0.1:0.1;2:2:14;22:-3:4] F=E([2 4],3:7) G=E(:,3:5) Command window Problem 32
  • 18. E = 7.0000 2.0000 -3.0000 1.0000 2.0000 2.0000 2.0000 0.7000 0.6000 0.5000 0.4000 0.3000 0.2000 0.1000 2.0000 4.0000 6.0000 8.0000 10.0000 12.0000 14.0000 22.0000 19.0000 16.0000 13.0000 10.0000 7.0000 4.0000 F = 0.5000 0.4000 0.3000 0.2000 0.1000 16.0000 13.0000 10.0000 7.0000 4.0000 G = -3.0000 1.0000 2.0000 0.5000 0.4000 0.3000 6.0000 8.0000 10.0000 16.0000 13.0000 10.0000 Question no 38 disp('Problem 38') A=[eye(2) zeros(2,1) ones(2)] B=[zeros(2) ones(2); zeros(1,4); ones(1,4)] C=[ones(4,2),zeros(4,2),[ones(1) zeros(1,3)]'] Command window Problem 38 A =
  • 19. 1 0 0 1 1 0 1 0 1 1 B = 0 0 1 1 0 0 1 1 0 0 0 0 1 1 1 1 C = 1 1 0 0 1 1 1 0 0 0 1 1 0 0 0 1 1 0 0 0 Question no 39 disp('Problem 39') A=eye(6) A(1:3,4:6)=eye(3) A(4:6,1:3)=eye(3) Command window Problem 39 A = 1 0 0 0 0 0 0 1 0 0 0 0
  • 20. 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 1 A = 1 0 0 1 0 0 0 1 0 0 1 0 0 0 1 0 0 1 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 1 A = 1 0 0 1 0 0 0 1 0 0 1 0 0 0 1 0 0 1 1 0 0 1 0 0 0 1 0 0 1 0 0 0 1 0 0 1 Question no 40 disp('Problem 40') A=ones(2) A(3:4,3:4)=A A=[A A] Command window
  • 21. Problem 40 A = 1 1 1 1 A = 1 1 0 0 1 1 0 0 0 0 1 1 0 0 1 1 A = 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 Chapter 3 Question no 1 disp('Problem 1') x=-2:4 Command window Problem 1
  • 22. x = -2 -1 0 1 2 3 4 Question no 2 disp('Problem 2') x=-3:3 y=(x.^2-2)./(x+4) Command window Problem 2 x = -3 -2 -1 0 1 2 3 y = 7.0000 1.0000 -0.3333 -0.5000 -0.2000 0.3333 1.0000 Question no 3 disp('Problem 3') x=1:7 y=(x-3).*(x.^2+3)./x.^2
  • 23. Command window Problem 3 x = 1 2 3 4 5 6 7 y = -8.0000 -1.7500 0 1.1875 2.2400 3.2500 4.2449 Question no 4 disp('Problem 4') t=0:8 y=20*t.^(2/3)./(t+1)-(t+1).^2./exp(0.3*t+5)+2./(t+1) Command window Problem 4 t = 0 1 2 3 4 5 6 7 8
  • 24. y = 1.9933 10.9800 11.2161 10.8566 10.4286 10.0259 9.6652 9.3455 9.0616 Question no 10 disp('Problem 10') v=[3 -2 4]; u=[5 3 -1]; v.*u v*u' v'*u Command window Problem 10 ans = 15 -6 -4 ans = 5 ans = 15 9 -3 -10 -6 2 20 12 -4
  • 25. Question no 11 disp('Problem 11') va=[6.5 -5 -4]; ua=[-3 8 -2]; dotuva=sum(u.*v) ub=[-3 8 -2]; vb=[6.5; -5; -4]; ub*vb vc=[6.5 -5 -4]; uc=[-3 8 -2]; dotuvc=dot(vc,uc) Command window Problem 11 dotuva = 5 ans = -51.5000 dotuvc = -51.5000
  • 26. Question no 12 disp('Problem 12') v=2:2:10 a=1./v b=1./v.^2 c=v/2 d=v./v Command window Problem 12 v = 2 4 6 8 10 a = 0.5000 0.2500 0.1667 0.1250 0.1000 b = 0.2500 0.0625 0.0278 0.0156 0.0100 c = 1 2 3 4 5 d = 1 1 1 1 1
  • 27. Question no 13 disp('Problem 13') v=5:-1:1 a=v.^2 b=v.^v c=v*5 d=v-1 Command window Problem 13 v = 5 4 3 2 1 a = 25 16 9 4 1 b = 3125 256 27 4 1
  • 28. c = 25 20 15 10 5 d = 4 3 2 1 0 Question no 14 disp('Problem 14') x=1:2:9; y=2:3:14; disp('Parta') za=x.*y.^2./(x+y) disp('Partb') zb=x.*(x.^2-y)-(x-y).^2 Command window Problem 14 Part a za = 1.3333 9.3750 24.6154 47.0556 76.6957
  • 29. Part b zb = -2 8 76 250 578 Question no 23 disp('Problem 23') na = 1:10; ya = 1./2.^na; disp('Parta') Sa = sum(ya) aPercentError=abs(1-Sa)*100 nb = 1:20; yb = 1./2.^nb; disp('Partb') Sb = sum(yb) bPercentError=abs(1-Sb)*100 nc = 1:30; yc = 1./2.^nc; disp('Partc') Sc = sum(yc) cPercentError=abs(1-Sc)*100 nd = 1:40; yd = 1./2.^nb; disp('Partd') Sd = sum(yd) dPercentError=abs(1-Sc)*100
  • 30. Command window Problem 23 Part a Sa = 0.9990 aPercentError = 0.0977 Part b Sb = 1.0000 bPercentError = 9.5367e-05
  • 31. Part c Sc = 1.0000 cPercentError = 9.3132e-08 Part d Sd = 1.0000 dPercentError = 9.3132e-08
  • 32. Problem 14 Part a za = 1.3333 9.3750 24.6154 47.0556 76.6957 Part b zb = -2 8 76 250 578 Command window Problem 23 Part a Sa = 0.9990
  • 33. aPercentError = 0.0977 Part b Sb = 1.0000 bPercentError = 9.5367e-05 Part c Sc = 1.0000 cPercentError =
  • 34. 9.3132e-08 Part d Sd = 1.0000 dPercentError = 9.3132e-08 Question no 24 disp('Problem 24') clear,clc na = 0:10; ya = (-3).^(-na)./(2*na+1); disp('Parta') Sa = sqrt(12)*sum(ya) aPercentError=abs((pi-Sa)/pi)*100 nb = 0:20; yb = (-3).^(-nb)./(2*nb+1); disp('Partb') Sb = sqrt(12)*sum(yb) bPercentError=abs((pi-Sb)/pi)*100 nc = 0:30; yc = (-3).^(-nc)./(2*nc+1);
  • 35. disp('Partc') Sc = sqrt(12)*sum(yc) cPercentError=abs((pi-Sc)/pi)*100 Command window Part a Sa = 3.1416 aPercentError = 2.0719e-05 Part b Sb = 3.1416 bPercentError =
  • 36. 1.8596e-10 Part c Sc = 3.1416 cPercentError = 2.8272e-14 Question no 32 disp('Problem 32') A=[3 1.5 1 0.5 4; -2 1 4 -3.5 2; 6 -3 2 2.5 1; 1 4 -3 0.5 -2; 3 2 -1 1.5 -3]; C=[-11.75; 19; -23; -1.5; -3.5]; x=AC Problem 32 x =
  • 37. -4.0000 2.5000 4.0000 1.0000 -2.0000 Chapter 5 Problem 1 Script disp('Problem 1') x=linspace(-3,5,200); y=(x+5).^2./(4+3*x.^2); plot(x,y) xlabel('x') ylabel('y') Commandwindow
  • 38. Problem 2 Script disp('Problem 2') fplot('5*sin(x)/(x+exp(-0.75*x))',[-5 10]) xlabel('x') ylabel('y') Commandwindow Problem 3 Script disp('Problem 3') x1=linspace(0,3,200); y1=(x1+1).*(x1-2).*(2*x1-0.25)-exp(x1); x2=linspace(-3,6,200);
  • 40. Problem 5 Script disp('Problem 5') fplot('exp(2*sin(0.4*x))*5*cos(4*x)',[-20 30]) xlabel('x') ylabel('y') Commandwindow Problem 6 Script disp('Problem 6') t=linspace(0,2*pi,100); x=1.5*sin(5*t);
  • 41. y=1.5*cos(3*t); plot(x,y) axis([-2 2 -2 2]) xlabel('x') ylabel('y') Commandwindow Problem 8 Script disp('Problem 8') t1=linspace(-30,-1.6,500); t2=linspace(-0.6,40,500); x1=3*t1./(1+t1.^3); y1=3*t1.^2./(1+t1.^3); x2=3*t2./(1+t2.^3); y2=3*t2.^2./(1+t2.^3); plot(x1,y1,x2,y2) xlabel('x') ylabel('y') Commandwindow