Fundamentals of MATLAB Programming

by Zara Noroozi

This is the textbook for ENGR 20: Introduction to MATLAB Programming at Irvine Valley College (IVC).

Description from LibreTexts.

Publisher
Irvine Valley College
Subjects
Engineering
Licence
CC BY-NC-SA 4.0, as LibreTexts states it. Non-commercial use only.
Who can read
Tweens profiles and older, judged from its title and subjects

Contents

LibreTexts writes equations in TeX, and here they show as TeX; the PDF has them typeset.

  1. Front Matter
  2. TitlePage
  3. InfoPage
  4. Table of Contents
  5. Licensing
  6. About This Book
  7. 1: Introduction
  8. 1.1: Learning Objectives
  9. 1.2: Why Should You Learn MATLAB?
  10. 1.3: What is MATLAB?
  11. 1.4: Getting to Know the MATLAB Environment
  12. 1.5: Using MATLAB Interactively
  13. 1.6: Variable and Assignment Statements
  14. 1.7: Useful Workspace Commands
  15. 1.8: A short Introduction to Binary Numbers and Computer Storage
  16. 1.9: MATLAB Data Types
  17. 1.9.1: Numeric Variables
  18. 1.9.2: Texts - Characters and Strings
  19. 1.9.3: Logical Variables
  20. 1.10: Numeric Expressions and Operations
  21. 1.11: Logical Operators
  22. 1.12: Getting Help in MATLAB
  23. 1.13: Common Mistakes and Best Practices
  24. 1.14: Chapter Exercises
  25. 2: Scripts and Functions
  26. 2.1: Learning Objectives
  27. 2.2: From Calculator Commands to Programs
  28. 2.3: MATLAB Scripts
  29. 2.4: Documenting Scripts with Comments
  30. 2.5: Getting Input from the User
  31. 2.6: Displaying Output - disp and fprintf
  32. 2.7: Scripts vs. Functions
  33. 2.8: Creating User-Defined Functions
  34. 2.9: Common MATLAB Math Fuctions
  35. 2.10: Common Mistakes and Best Practices
  36. 2.11: Chapter Exercises
  37. 3: One-Dimensional Arrays
  38. 3.1: Learning Objectives
  39. 3.2: Why Arrays Matter
  40. 3.3: Creating One-Dimensional Numeric Arrays (Vectors)
  41. 3.4: Common Vector Operations
  42. 3.5: Extending and Deleting Elements
  43. 3.6: Length and Size
  44. 3.7: Finding Minimum and Maximum Values
  45. 3.8: Logical Arrays and Logical Indexing
  46. 3.9: Scalar Arithmetic with Arrays
  47. 3.10: Element-by-Element Array Operations
  48. 3.11: Arrays as Function Arguments
  49. 3.12: Common Vector Operations
  50. 3.13: Common Mistakes and Best Practices
  51. 3.14: Chapter Exercises
  52. 4: Two-Dimensional Arrays
  53. 4.1: Learning Objectives
  54. 4.2: Why Two-Dimensional Arrays Matter
  55. 4.3: Creating and Indexing a 2D Array
  56. 4.4: Extracting Rows, Columns, and Subarrays
  57. 4.5: Modifying and Extending a Matrix
  58. 4.6: Concatinating 2D Arrays
  59. 4.7: Flattening and Deleting Parts of a Matrix
  60. 4.8: Logical Indexing with 2D Arrays
  61. 4.9: The end, size, length, numel, min, and max functions
  62. 4.10: Special 2D Arrays
  63. 4.11: More Matrix Functions
  64. 4.12: Array Operations vs. Matrix Operations
  65. 4.13: Sorting Arrays
  66. 4.14: Logical Functions for Arrays
  67. 4.15: Common Mistakes and Best Practices
  68. 4.16: Chapter Exercises
  69. 5: Branches
  70. 5.1: Learning Objectives
  71. 5.2: Why Programs Need Branches
  72. 5.3: Conditions and Decision Making
  73. 5.4: The if Statement
  74. 5.5: The if-else Statement
  75. 5.6: Multiple Branches with if-elseif-else
  76. 5.7: The Switch Statement
  77. 5.8: Common Mistakes and Best Practices
  78. 5.9: Chapter Exercises
  79. 6: Loops
  80. 6.1: Learning Objectives
  81. 6.2: Why Do We Need Loops?
  82. 6.3: while Loops
  83. 6.4: for Loops
  84. 6.5: Processing Arrays with for Loops
  85. 6.6: Nested Loops
  86. 6.7: The break Statement
  87. 6.8: The continue Statement
  88. 6.9: while Loops vs. for Loops
  89. 6.10: Common Mistakes and Best Practices
  90. 6.11: Practice Exercises
  91. 7: Strings and Character Arrays
  92. 7.1: Learning Objectives
  93. 7.2: Why Text Matters in MATLAB
  94. 7.3: Creating Strings
  95. 7.4: Creating Character Vector
  96. 7.5: Converting Between Strings and Character Vectors
  97. 7.6: Counting Characters- strlength vs. length
  98. 7.7: Comparing Text
  99. 7.8: Checking Text Types and Properties
  100. 7.9: Finding Text
  101. 7.10: Parsing and Editing Text
  102. 7.11: Converting and Formatting Text
  103. 7.12: Combining Text
  104. 7.13: Common Mistakes and Best Practices
  105. 7.14: Chapter Exercises
  106. 8: Data Structures
  107. 8.1: Learning Objectives
  108. 8.2: Introduction- When Regular Arrays are Not Enough
  109. 8.3: Review- Homogeneous and Heterogeneous Data
  110. 8.4: Cell Arrays
  111. 8.5: Structures
  112. 8.6: Arrays of Structures
  113. 8.7: Tables
  114. 8.8: Common Mistakes and Best Practices
  115. 8.9: Chapter Exercises
  116. 9: File Input - Output
  117. 9.1: Learning Objectives
  118. 9.2: Why File Input and Output Matters
  119. 9.3: Simple File I/O with load and save
  120. 9.4: Limitations of load and save
  121. 9.5: The Three-Step Process for Advanced File I/O
  122. 9.6: Reading Mixed Data with textscan
  123. 9.7: Reading One Line at a Time with fgetl
  124. 9.8: Writing Formatted Text with fprintf
  125. 9.9: Spreadsheet File I/O
  126. 9.10: Storing File Content in an M-File
  127. 9.11: Choosing the Right File I/O Tool
  128. 9.12: Common Mistakes and Best Practices
  129. 9.13: Chapter Exercises
  130. 10: Plotting
  131. 10.1: Learning Objectives
  132. 10.2: Why Data Visualization Matters
  133. 10.3: Creating Simple Plots
  134. 10.4: Creating Subplots
  135. 10.5: Plots with Error Bars
  136. 10.6: Other Common 2D Plot Types
  137. 10.7: Changing Graphics Properties
  138. 10.8: Histograms
  139. 10.9: Pie Charts
  140. 10.10: Scatter Plots
  141. 10.11: Three-Dimensional Plots
  142. 10.12: Animated Plots
  143. 10.13: Mesh and Surface Plots
  144. 10.14: Saving and Opening Figures
  145. 10.15: Choosing the Right Plot Type
  146. 10.16: Common Mistakes and Best Practices
  147. 10.17: Chapter Exercises
  148. 11: Introduction to Simulink
  149. 11.1: Learning Objectives
  150. 11.2: What is Simulink?
  151. 11.3: Getting Started with Simulink
  152. 11.4: Basic Simulink Vocabulary
  153. 11.5: Example- Adding Two Numbers
  154. 11.6: Subtracting Two Numbers
  155. 11.7: Using MATLAB Variables in Simulink
  156. 11.8: Example- Evaluating an Expression
  157. 11.9: Time-Varying Signals and the Scope Block
  158. 11.10: Modeling y = sin(x)/x
  159. 11.11: Exporting Simulink Output to MATLAB
  160. 11.12: Solving Differential Equations in Simulink
  161. 11.13: Example- Falling Object with Air Drag
  162. 11.14: Example- Falling Object Position
  163. 11.15: Common Mistakes and Best Practices
  164. 11.16: Chapter Exercises
  165. 12: Applied Mathematics
  166. 12.1: Learning Objectives
  167. 12.2: Why Applied Mathematics Matters in MATLAB
  168. 12.3: Polynomials in MATLAB
  169. 12.4: Interpolation
  170. 12.5: Curve Fitting
  171. 12.6: Anonymous Functions
  172. 12.7: Numerical Integration
  173. 12.8: Numerical Differentiation and Polynomial Derivatives
  174. 12.9: Finding Roots
  175. 12.10: Common Mistakes and Best Practices
  176. 12.11: Chapter Exercises
  177. 13: Linear Algebra
  178. 13.1: Learning Objectives
  179. 13.2: Why Linear Algebra Matters
  180. 13.3: Vectors in MATLAB
  181. 13.4: Vectors as Physical Quantities
  182. 13.5: Vector Scalar Multiplication
  183. 13.6: Array Operations Review
  184. 13.7: Dot Product of Two Vectors
  185. 13.8: Cross Product of Two Vectors
  186. 13.9: Magnitude and Unit Vectors
  187. 13.10: Special Matrices and Matrix Operations
  188. 13.11: Matrix Addition and Subtraction
  189. 13.12: Matrix Scalar Multiplication
  190. 13.13: Matrix Multiplication
  191. 13.14: Matrix Determinant
  192. 13.15: Matrix Inverse
  193. 13.16: Linear Algebraic Equations
  194. 13.17: Writing a Linear System as Ax = b
  195. 13.18: Solving Ax = b
  196. 13.19: Possible Solutions to a Linear System
  197. 13.20: Strategy for Setting Up Linear Systems
  198. 13.21: Visualizing a 2 by 2 System of Equations
  199. 13.22: Common Mistakes and Best Practices
  200. 13.23: Chapter Exercises
  201. 14: Symbolic Math
  202. 14.1: Learning Objectives
  203. 14.2: Introduction- Why Symbolic Math?
  204. 14.3: Creating and Evaluating Symbolic Variables and Expressions
  205. 14.4: Symbolic Differentiation
  206. 14.5: Symbolic Integration
  207. 14.6: Solving Equations Symbolically
  208. 14.7: Solving Systems of Equations
  209. 14.8: Simplifying, Expanding, and Factoring Expressions
  210. 14.9: Solving Differential Equations with dsolve
  211. 14.10: Plotting Symbolic Expressions
  212. 14.11: Common Mistakes and Best Practices
  213. 14.12: Chapter Exercises
  214. Back Matter
  215. Index
  216. Glossary
  217. Detailed Licensing
  218. Detailed Licensing