Group Assignment 2 Chapter 3

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 4

Group Assignment 2 (Chapter 3)

Group Number: 7
Group Name: The 4 Amigos

Group members: (Name, and Student ID)


1. Joory Amoun A21ET4004
2. Sam Nureszren bin Mohd Faisal A21ET0211
3. Teow Zi Xian A21ET0241
4. Bader Khairi Ismail Hashim A20ET4004

Problem Command Done by


3.9
1 >> x=-3:1:3; Bader
>> y=x.^2-exp(0.5*x)+x

y=

5.7769 1.6321 -0.6065 -1.0000 0.3513 3.2817 7.5183

2 >> x=1:1:6; Bader


>> y=(x+5).^3./x.^2

y=

216.0000 85.7500 56.8889 45.5625 40.0000 36.9722

3 >> x=[1.5:1:5.5, 6.6]; Bader


>> y=(x+7).^4/(x+1).*sqrt(x)

y=

1.0e+03 *

4.4287 5.7174 6.7649 7.6707 8.4803 9.2897

4 >> x=20:10:70; Sam


>> y=(2*sind(x)+cosd(x))./sind(x).^2

y=

13.8807 7.4641 4.9655 3.7062 2.9761 2.5157


5 >> s=50:50:250; Sam
>> r=sqrt(s./pi)/2;
>> V=4*pi*r.^3/3;
>> [s;V]'

ans =

50.0000 33.2452
100.0000 94.0316
150.0000 172.7471
200.0000 265.9615
250.0000 371.6925

6 (a) Sam
>> e=8.85*10^-12;
>> R=6;
>> lambda=1.7*10^-7;
>> z=0:2:10;
E=(lambda/2*e).*(R.*z./(z.^2+R.^2).^(3/2))

E=

1.0e-19 *

0 0.3568 0.4815 0.4433 0.3611 0.2846

(b)
>> max(E)

ans =

4.8147e-20

8 (a) Joory
>> u=[23.5 -17 6];
>> length=sqrt(sum(u.*u))
length =

29.6184

12 (a) Joory
>> v=2:1:6;
>> a=2*v

a=

4 6 8 10 12
(b)
>> b=v.^3

b=

8 27 64 125 216

(c)
>> c=v.^v

c=

4 27 256 3125 46656

(d)
>> d=v./2

d=

1.0000 1.5000 2.0000 2.5000 3.0000

24 Script File Joory


format long
% part a
n=0:5;
an=1./(2.^n);
Sa=sum(an)
% part b
n=0:10;
bn=1./(2.^n);
Sb=sum(bn)
% part c
n=0:15;
cn=1./(2.^n);
Sc=sum(cn)

Command Window
Sa =

1.968750000000000

Sb =

1.999023437500000

Sc =

1.999969482421875
25 >> format long Zixian
>> x=[1 0.5 0.1 0.01 0.001 0.0001];
>> y=(cosd(2*x)-1)./(cosd(x)-1)

y=

3.999695390313371 3.999923846129744
3.999996953803101 3.999999985421411 4.000000000000000
3.999927108389824

26 >> format long Zixian


>> x=[2 1.5 1.1 1.01 1.001 1.00001 1.0000001];
>> y=(x.^1/3-1)./(x.^1/4-1)

y=

0.666666666666667 0.800000000000000 0.873563218390805


0.887402452619844 0.888740691341558 0.888887407402469
0.888888874074074

27 >> P=10:10:200; Zixian


>> Q=1020*sqrt(P).*(1-0.01*sqrt(P))

Q=

1.0e+04 *

Columns 1 through 5

0.312352321337175 0.435757867409957 0.528077008655269


0.604304642674349 0.670248916810278

Columns 6 through 10

0.728888602626313 0.781993227064757 0.830715734819914


0.875856964011524 0.918000000000000

Columns 11 through 15

0.957585025133554 0.994954017310539 1.030378933601121


1.064080275752322 1.096239768819421

Columns 16 through 20

1.127009285348699 1.156517290661341 1.184873602229871


1.212172972713203 1.238497833620557

You might also like