Beruflich Dokumente
Kultur Dokumente
GROUP:ec2216c1
DATE :
(STUDENTS ARE REQUIRED TO WRITE THEIR CODE AND ANSWERS IN THIS GIVEN BOX ANSWER
AND CONVERT IT TO PDF FORMAT)
PROBLEM 1
Given a Table 1 of a data for the human population from the year of 1984 to 1996.
a) Create separate row matrix in MATLAB for storing the year and the population
b) Create separate column matrix in MATLAB for storing the year and population
>> year'
>> population'
>> year=1984:2:1996
d) Using MATLAB, compute the maximum, mean and the summation of the population
>>mea>> maximum=max(population)
>> summation=sum(population)
>> mean=mean(population)
PROBLEM 2
>> F = 5*B
>> J=A-B
>> K=A+B
>> A*C
>> A.*C
>> A./C
>> A.^C
PROBLEM 3
The axial force, Fi, in each of the 13 member pin connected truss, can be calculated by solving the
following system of 13 equations;
F2 +0.7071F1 =0
-F2 +F6 =0
F3 -2000 =0
F4 +0.6585F3 -0.7071 F1 =0
F7 +0.6585F8 –F4 =0
F9 +0.7526F5 -4000=0
0.7071F11 –F7 =0
F13 +0.7071F11 =0
a) Convert the simultaneous linear equations in form of [K]{x} = {D} in register [K] and {D}
matrix in the MATLAB script
>> K1=[0.7071 1 0 0 0 0 0 0 0 0 0 0 0]
>> K2=[0 -2 0 0 0 1 0 0 0 0 0 0 0]
>> K3=[0 0 1 0 0 0 0 0 0 0 0 0 0]
>> K=[K1;K2;K3;K4;K5;K6;K7;K8;K9;K10;K11;K12;K13]
b) Find the inverse and the determinant of [K} using MATLAB script
>> K^(-1)
c) Determine the {x} by multiplying the inverse of [K} with {D} using MATLAB script
>> D={-2000 -2000 2000 -1000 -2000 -2000 -500 -2000 4000 -2000 -500 2000 -2000}
e) Using MATLAB, extract the first column, the third row, second and fourth row, the 10th and
13 column of [K]
>> K(:,1)
>> K(3,:)
>> K([2,4],:)
>> K(:,[10,13])
f) Using MATLAB, delete the first row and 13th column of matrix [K]
>> K(1,:)=[ ]
>> K(1,:)=[ ]