1 MATLAB is a registered trademark of the MathWorks, Inc.
2 The MATLAB Symbolic Math Toolbox is a registered trademark of the MathWorks, Inc.
3 Actually these are symbolic objects in MATLAB but objects are beyond the scope of this book.
4 The unit “bytes” is a measure of how much storage the variables take in the computer memory or disk. For example, a kilobyte (KB) is one thousand bytes and a megabyte (MB) is one million bytes.
5 The “class” of a variable indicates the type of the variable. For example, all the variables in this session are of the class “double array”. By default, all variables are stored as arrays (i.e. matrices) in MATLAB.
6 Actually these are symbolic objects in MATLAB but objects are beyond the scope of this book.
7 MATLAB also has the special functions of mathematics like the Gamma function, the Error function, and Bessel functions but these are beyond the scope of this book.
8 In this chapter we deal with square roots of positive numbers. Square roots of negative numbers are dealt with in the next chapter where we introduce complex numbers.
9 We mean here vectors of numbers or scalars. There are also vectors of strings and characters in MATLAB but these are beyond the scope of this book.
10 There is also a logspace
command in MATLAB but its use is beyond the scope of this book. It basically deals with generating logarithmically spaced vectors.
11 Actually, to be precise, it is called linearly spaced.
12 The reader is advised to consult a book on vector analysis for more details about this product.
13 Sorting can also be obtained in a descending order but this is beyond the scope of this book. This simple example of sorting is included to show the various capabilities of MATLAB.
14 MATLAB can handle also multi-dimensional arrays but this is beyond the scope of this book.
15 We can divide two matrices in MATLAB using the backslash operator “\” but this is not a true division operation but related to the solution of the system of equations represented by the matrices. For more details about this operation, see Chapter 10 on solving equations.
16 An identity matrix is a matrix with 1’s on the main diagonal and 0’s everywhere else. The identity matrix is very useful in matrix algebra.
17 The sum of a matrix and its transpose will always be a symmetric matrix.
18 Consult a book on matrix algebra to find the exact definition of the upper triangular part and the lower triangular part of a matrix.
19 The trace and determinant of a matrix are not equal although in our example here both turn out to be 12 – a coincidence.
20 Consult a book on matrix algebra for the exact definition of the norm of a matrix.
21 The eigenvalues of a matrix are its principal values.
22 For details about the definitions of the eigenvalues of a matrix and its characteristic polynomial, consult a book on linear algebra.
23 The interested reader may consult the references listed at the end of this book for more details about programming in MATLAB.
24 This means that there are rules for writing functions in MATLAB.
25 The name of the function must be exactly the same as the name of the function file it is stored in.
26 Consult a book on programming for more details about functions and return values. In other programming languages, functions are called procedures or subroutines and have a different structure than in MATLAB.
27 No units are used in this example.
28 The two words “execute” and “run” are used interchangeably in this chapter. They are basically equivalent for our purpose in this chapter.
29 Note that no units are specified for the dimensions used in this example.
30 It should be noted that these programming constructs are also available in other programming languages but they have a different structure, i.e. different rules for their implementation.
31 The logical operator “less than” is represented in MATLAB by the symbol <. We do not cover logical operators in this book but this is an instance where their use is needed.
32 Note that there other variations of the above constructs used for implementing decisions in MATLAB, e.g. the If Else
construct (see the last section in this chapter on the Symbolic Math Toolbox to see an example of using this construct). Consult a book dedicated on programming in MATLAB for more details about these constructs.
33 The true square root of a matrix using the sqrtm
command is not defined for symbolic variables in MATLAB.
34 These commands may be entered individually on the command prompt or stored as a script in a script file. See Chapter 8 for details about scripts and script files.
35 Several logarithmic plots can also be generated by using the MATLAB command loglog
. Semi-logarithmic plots can also be generated by using the MATLAB commands semilogx
or semilogy
but their use is beyond the scope of this book.
36 These commands may be entered individually on the command prompt or stored in as a script in a script file. See Chapter 8 for details about scripts and script files.
37 Consult a book on linear algebra for the proof of this solution.
38 The roots
command can only be used with numerical computations.
39 We can use the MATLAB command pretty
to display the solution in a nice way but this will not be done here. The correct use of the pretty
command in the example above would be pretty(x)
.
40 See a book on calculus for details about these mathematical operations.
41 The inline
command is part of the main MATLAB package, not the Symbolic Math Toolbox.
42 See the chapter on vectors for more details about this command.
43 One of these commands has been used in a previous chapter.
44 A differential equation is an equation that has one or more derivatives as the unknown(s). Actually, the unknowns are functions that need to be determined.
45 There is a number of such commands in MATLAB called ODE Solvers for the numerical solution of ordinary differential equations. These commands are part of the main MATLAB package and are not associated with the MATLAB Symbolic Math Toolbox