George Mason University MATLAB Computer Programming Questions

I have attached the exercises.

Save Time On Research and Writing
Hire a Pro to Write You a 100% Plagiarism-Free Paper.
Get My Paper

The required exercises are:

  • 4.1
  • 4.9 : Use a stepsize of 100 for both Temperature and Pressure.
  • 4.14

140 Chapter 4 Manipulating MATLAB
KEY TERMS
subscripts
elements
index numbers
magic matrices
mapping
PROBLEMS
Manipulating Matrices
4.1 Create the following matrices, and use them in the exercises that follow:
15
3
22
a =
3
8
5
–CO
c= [12 18 5 2]
14 3
82
(a) Create a matrix called d from the third column of matrix a.
(b) Combine matrix b and matrix d to create matrix e, a two-dimensional
matrix with three rows and two columns.
(c) Combine matrix b and matrix d to create matrix f, a one-dimensional
matrix with six rows and one column.
(d) Create a matrix g from matrix a and the first three elements of matrix c,
with four rows and three columns.
(e) Create a matrix h with the first element equal to 21,3, the second element
equal to C1,2, and the third element equal to b2,1.
4.2 Load the file thermo_scores.dat provided by your instructor, or enter the matrix
shown in Table P4.2 and name it thermo_scores. (Enter only the numbers.)
Table P4.2 Thermodynamics Test Scores
Student No.
Test 1
Test 2
Test 3
45
54
67
66
68
67
65
69
62
92
93
91
92
96
90
89
68
83
61
70
75
82
57
5
76
85
62
71
96
78
76
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
89
97
52
34
45
94
87
85
56
45
65
43
72
75
83
93
76
65
67
68
90
87
97
95
89
88
91
92
Problemy 145
heighi h
Figuro P4.8
Baromoter.
P= hpp
This cquation could be sohod for the height:
р
A
pg
Find the height to which the liquid column will rise for pressures from 0) 10 100
kPa for and diffcrent barometers. Asume that the first uses mcrcury, with a
density of 13.56 g/cm (13,560 kg/m) and the sccond uiscs walcr, with a den-
sity of 1.0 g/cor’ (1000 kg/m’). The acceleration due to gravity in 9.81 m/s.
Before you start calculating, be sure to check the units in this calculation. The
metric measurement of pressure is a pascal (P-1). cqual to 1 kg/n. Akla is
1000 times as big as a Pa. Your answer should be a two-dimensional matrix.
4.9 The ideal gas law, Pu = RT, describes the behavior of many gascs, When
solved for v (the specific volume, m\/kg), the cquation can be written
RT
P.
Find the specific volume for air, for temperatures from 100 to 1000 K and
for pressures from 100 kPa to 1000 kPa. The value of R for air is 0.2870 kJ/
(kg K). In this formulation of the ideal gas law, R is different for every gas.
There are other formulations in which R is a constant, and the molecular
weight of the gas must be included in the calculation. You’ll learn more
about this equation in chemistry classes and thermodynamics classes. Your
answer should be a two-dimensional matrix.
Special Matrices
4.10 Create a matrix of zeros the same size as each of the matrices a, b, and c from
4.1. (Use the size function to help you accomplish this task.)
4.11 Create a 6 x 6 magic matrix.
(a) What is the sum of each of the rows?
(b) What is the sum of each of the columns?
(c) What is the sum of each of the diagonals?
4.12 Extract a 3 x 3 matrix from the upper left-hand corner of the magic matrix
you created in 4.11. Is this also a magic matrix?
4.13 Create a 5 x 5 magic matrix named a.
(a) Is a times a constant such as 2 also a magic matrix?
(b) If you square each element of a, is the new matrix a magic matrix?
(c) If you add a constant to each element, is the new matrix a magic matrix?
(d) Create a 10 x 10 matrix out of the following components (see Figure
P4.13):
• The matrix a
• 2 times the matrix a
• A matrix formed by squaring each element of a
• 2 plus the matrix a
Is your result a magic matrix? Does the order in which you arrange the com-
ponents affect your answer?

  • 4.14
  • Albrecht Dürer’s magic square (see Figure 4.8) is not exactly the same as the
    4 X 4 magic square created with the command
    magic (4)
    (a) Recreate Durer’s magic square in MATLAB® by rearranging the columns.
    (b) Prove that the sum of all the rows, columns, and diagonals is the same.
    a
    2*a
    a^2
    a+2
    Figure P4.13
    Create a matrix out of other
    matrices.

    Save Time On Research and Writing
    Hire a Pro to Write You a 100% Plagiarism-Free Paper.
    Get My Paper
    Still stressed from student homework?
    Get quality assistance from academic writers!

    Order your essay today and save 25% with the discount code LAVENDER