Week 1 Challenge - Introduction to MATLAB and Basics of Structural Engineering
1) a) Assume a Howe Truss. Per Structural Idealization, draw a line model for the
truss and state your assumptions

Above is line model of Howe Truss.
b) From the line model :-
No. of reactions r = 3
No. of members m = 13
No. of joints j = 8
c) According to equation :-
m+r = 2j
as m+r = 16 and 2j = 16,
so LHS =RHS
The above structure is stable structure.
d) The structure is an externally stable structure.
e) Structure is an internally stable structure as load application does not change its shape.
f) According to equation structure is determinate if
m+r<=2j
Here m+r=2j so structure is determinate.
g) No, this structrure is unstable.
As no. of links m = 6,
no. of joints j = 5,
no. of reactions r = 3.
so m+r<2j which states that structure is unstable.
2) Create a Matlab script and assume variables a,b,c. Assign random numbers for variables a,b,c. Perform mathematical operations as listed and list the answers -
Ans:-
Let,
a =
1 2
3 4
,
b =
2 4
6 8
&
c =
3 5
7 9
i) a*b.^c =
559880 268436480
1119768 536873984
ii) (a*b).^c =
1.0e+14 *
0.0000 0.0000
0.0002 6.1812
iii) a-b.^c =
-7 -1022
-279933 -134217724
iv) a.^b-c =
-2 11
722 65527
v) a.^b\c =
3.6475 6.0799
-0.0405 -0.0675
vi) a.^b/c =
1.0e+04 *
0.0013 -0.0005
5.6524 -2.4120
3) Understanding vector algebra. Perform Matlab script operations to create a row vector and perform followin commands.
Ans:-
% Use colon operator to create row vector by default and by specifying a range
A = 2:5:20
% Use linspace command to generate vectors automatically
B = linspace(5,50,10)
% To arrive at length of vector
A_length = length(A)
% To arrive at size of vector
B_size = size(B)
% Access elements in a vector
Element = A(1,3)
% Access a range of elements
Range = B(1,5:10)
% Perform transpose of matrix
A_transpose = A'

4) Create a matrix with m rows and n columns A and B and perform the following commands
Ans:-
Let,
A =
1 2 3
4 5 6
7 8 9
and
B =
2 4 6
3 6 9
3 5 7
i) A*B =
17 31 45
41 76 111
65 121 177
ii) A\B =
1.0e+16 *
-0.3153 -0.9458 -1.5763
0.6305 1.8915 3.1525
-0.3153 -0.9458 -1.5763
iii) A/B =
0.5000 0 0
0 -1.6667 3.0000
0 -3.6667 6.0000
iv) A^2 =
30 36 42
66 81 96
102 126 150
v) A^2-A*A =
0 0 0
0 0 0
0 0 0
vi) A.^2 =
1 4 9
16 25 36
49 64 81
vii) A.^2-A^2 =
-29 -32 -33
-50 -56 -60
-53 -62 -69
5) Create a Matlab script to understand the standard commands to create standard matrices
Ans:-
i) ones(3) =
1 1 1
1 1 1
1 1 1
ii) zeros(3) =
0 0 0
0 0 0
0 0 0
iii) eye(3) =
1 0 0
0 1 0
0 0 1
iv) diag(eye(3)) =
1
1
1
6) Create a Matlab script to perform selecting and changing parts of matrices
Ans:-
% creating random 3x3 matrix
A = rand(3)
%accessing single element in matrix A
single_element = A(2,3)
% accessing all rows in matrix A
all_rows_of_2nd_column = A(:,2)
% accessing all column in matrix A
all_column_of_3rd_row = A(3,:)
% replacing 3rd row elements
A(3,:)= [4 5 6]
% replacing 2nd column elements
A(:,2) = [7 8 9]
outputs -
