Matlab and Octave Programming for STEM Applications

by Cary Smith

Textbook Matlab/Octave Programming for STEM Applications. This text emphasizes practical applications of MATLAB in engineering, physics, mathematics and biology. Intended for California ENGR C-ID 220

Description from LibreTexts.

Publisher
Oxnard 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. Front Matter
  3. TitlePage
  4. InfoPage
  5. Table of Contents
  6. Licensing
  7. TitlePage
  8. InfoPage
  9. Table of Contents
  10. Licensing
  11. Preface
  12. 1.1: Notes to the Instructor
  13. Authors and Sources
  14. Purpose of This Book
  15. How this Book Was Assembled
  16. Back Matter
  17. Index
  18. Glossary
  19. Detailed Licensing
  20. 1: Modeling, Simulation, and MATLAB’s Interpreter
  21. 1.1: Obtaining MATLAB and Octave
  22. 1.2: Modeling
  23. 1.3: A Glorified Calculator
  24. 1.3.1: log(), round(), floor(), and ceil() functions
  25. 1.3.2: Trigonometry Functions
  26. 1.4: MATLAB User Interface
  27. 1.5: Octave User Interface
  28. 1.6: Variables and Assignment Statements
  29. 1.6.1: More About Valid Variable Names
  30. 1.7: Clearing the Workspace, Readability Tips
  31. 1.8: Errors
  32. 1.9: Built-in Function Documentation
  33. 1.10: Chapter Review
  34. 1.11: Chapter 1 videos English and Espanol
  35. 1.12: Exercises
  36. 2: MATLAB/Octave Scripts
  37. 2.1: How to Create a Script File and Valid File Names
  38. 2.2: Your First Script
  39. 2.2.1: .mlx Live Editor Files
  40. 2.3: Examples of assignment scripts
  41. 2.4: Why Scripts?
  42. 2.5: The Fibonacci Sequence
  43. 2.6: Floating-Point Numbers
  44. 2.7: Scientific Notation for Large and Small Numbers
  45. 2.8: Number formats
  46. 2.9: Complex Numbers
  47. 2.10: Script Comments
  48. 2.11: Script Documentation
  49. 2.12: Assignment and Equality
  50. 2.13: Understanding Editor Warning and Error messages
  51. 2.14: Debugging Directory Errors
  52. 2.15: Chapter Review
  53. 2.16: Chapter 2 Scripts videos English and Espanol
  54. 2.17: Exercises
  55. 2.17.1: More Exercises
  56. 3: for Loops, Ploting Points, Sequences, and Series
  57. 3.1: Updating Variables
  58. 3.2: Bug Taxonomy
  59. 3.3: Absolute and Relative Error
  60. 3.4: for Loops
  61. 3.4.1: for Loop Supplemental Material
  62. 3.5: Plotting Points
  63. 3.5.1: Create a 2D x-y Sine-Wave Plot with a for Loop
  64. 3.6: Sequences
  65. 3.6.1: Sequences Additional Material
  66. 3.7: Series
  67. 3.7.1: Series Additional Material
  68. 3.8: Generalization
  69. 3.9: Incremental Development
  70. 3.10: for Loop Incremental Development Exercise
  71. 3.11: Chapter Review
  72. 3.12: Chapter 3 for loop Videos in English and Espanol
  73. 3.13: Exercises
  74. 4: Vectors
  75. 4.1: Creating Vectors
  76. 4.2: Methods to Create Vectors in MATLAB
  77. 4.3: Vector Arithmetic
  78. 4.4: Selecting Elements
  79. 4.5: Indexing Errors
  80. 4.6: Vectors and Sequences
  81. 4.7: disp() and num2str() Functions and Concatenation
  82. 4.8: Plotting Vectors
  83. 4.8.1: Plotting Vectors Additional Material
  84. 4.9: Recursive for Loops
  85. 4.10: Common Vector Operations
  86. 4.11: Common Vector Functions
  87. 4.12: Chapter Review
  88. 4.13: Chapter 4 Vector Videos In English and Espanol
  89. 4.14: Exercises
  90. 5: User-Defined Functions
  91. 5.1: Name Collisions
  92. 5.2: Defining Functions
  93. 5.2.1: Function Case Study (Lambert)
  94. 5.3: Function Documentation
  95. 5.4: Naming Functions
  96. 5.4.1: Function Names and MATLAB Keywords
  97. 5.5: Functions With Multiple Input Variables
  98. 5.5.1: Multiple Inputs Examples and Exercises
  99. 5.5.2: Mutiple Inputs Example- Ideal Gas law (Lambert)
  100. 5.6: Functions with Multiple Outputs
  101. 5.7: Matlab Functions with No Inputs
  102. 5.8: Matlab Functions with No Outputs
  103. 5.9: Matlab Functions with No Inputs and No Outputs
  104. 5.10: Functions with variable numbers of inputs or outputs
  105. 5.11: How Functions Work
  106. 5.12: Chapter Review
  107. 5.13: Chapter 5 Function videos English and Espanol
  108. 5.14: Exercise
  109. 6: Conditionals Part 1
  110. 6.1: Relational Operators
  111. 6.1.1: Relational Operators List
  112. 6.1.2: Octave vs. MATLAB--not equal, end, endif, endfunction
  113. 6.2: if Statement
  114. 6.3: if, else, elseif
  115. 6.4: Incremental Development
  116. 6.5: Logical Functions
  117. 6.6: Nested for Loops
  118. 6.7: Putting It Together
  119. 6.8: Encapsulation and Generalization
  120. 6.9: Adding a continue Statement
  121. 6.10: Chapter Review
  122. 6.11: Chapter 6 if-logic videos English and Espanol
  123. 6.12: Exercise
  124. 7: Conditionals Part 2- Series, Switch Logic, Error Checking, and While Loops
  125. 7.1: if, elseif, else with Error Checking
  126. 7.2: Flowcharts
  127. 7.3: The input() Function
  128. 7.4: Compound Logical Operators
  129. 7.4.1: Compound if, elseif Logic Examples
  130. 7.5: Working with Conditions
  131. 7.6: Shortcut and, or, Logical Operations
  132. 7.7: for loops with break Logic
  133. 7.8: 'while' Loops
  134. 7.9: 'switch' Logic
  135. 7.10: The find() function
  136. 7.11: Chapter 7 Conditionals, Part 2, Videos English and Espanol
  137. 8: User-defined Functions of Vectors
  138. 8.1: Functions and Vectors
  139. 8.1.1: Built-in MATLAB Functions of Vectors
  140. 8.1.2: User-Defined Functions of Vectors Examples and Exercises
  141. 8.2: Computing with Vectors
  142. 8.3: Debugging in Four Acts
  143. 8.3.1: Debugging Theorems all in 1 Place
  144. 8.4: Chapter Review
  145. 8.5: Chapter 8 Function Videos English and Espanol
  146. 9: MATLAB Random Number and Statistics Functions
  147. 9.1: MATLAB Random Number Functions
  148. 9.2: MATLAB Statistics Functions
  149. 9.3: Statistical Plots
  150. 9.4: Random Number Applications
  151. 9.5: Chapter 9 Random Number Videos English and Espanol
  152. 10: Interpolation and Curve Fitting
  153. 10.1: Linear Interpolation
  154. 10.1.1: Linear Interpolation Problem Set
  155. 10.2: Nonlinear Interpolation
  156. 10.3: Linear and Polynomial Curve Data Fitting
  157. 10.4: Polynomial Fitting Problem Set
  158. 10.5: Interactive Fitting Tools
  159. 10.6: Chapter 10 Curve Fitting Videos in English and Espanol
  160. 11: Zero Finding and Fourier Transforms
  161. 11.1: Solving Nonlinear Equations with fzero()
  162. 11.2: fzero() Examples and Exercises
  163. 11.3: Using fzero() to find the intersection of 2 functions
  164. 11.4: Subfunctions
  165. 11.5: Anonymous (or In-Line) Functions
  166. 11.6: Debugging- More Name Collisions
  167. 11.7: Fourier Transforms
  168. 11.8: Chapter Review
  169. 11.9: Chapter 11 Zero finding Videos English and Espanol
  170. 11.10: Exercises
  171. 12: MATLAB Matrices (Arrays)
  172. 12.1: Creating Matrices and Arrays
  173. 12.3: Common Matrix Functions
  174. 12.4: Matrix Indexing
  175. 12.5: Matrix Operations, Introduction
  176. 12.6: Matrix Tables and Nested Loops
  177. 12.7: Dot Product
  178. 12.8: Cross Product and Torque
  179. 12.9: Chapter 12 Matrix Videos English and Espanol
  180. 13: Linear Algebra
  181. 13.1: Basic Matrix Multiplication
  182. 13.2: Matrix Multiplication Applications
  183. 13.3: Matrix Inverse, Rank and Determinant
  184. 13.4: Solving Systems of Equations
  185. 13.5: Systems of Equations Examples and Exercises
  186. 13.6: Over-Determined Systems of Equations
  187. 13.7: Chapter 13 Linear Algebra Videos in English and Espanol
  188. 14: Advanced Plotting
  189. 14.1: scatter, scatter3
  190. 14.2: Plot 3D Surface and Contour Plots
  191. 14.3: Advanced Plot Formatting
  192. 14.4: Log plots
  193. 14.5: Subplots
  194. 14.6: Chapter 14 Advanced Plotting Videos in English and Espanol
  195. 15: Formatted Input and Output
  196. 15.1: sprintf() and fprintf(), Introduction
  197. 15.2: fprintf() to a file
  198. 15.3: Reading from an Excel file in MATLAB and Octave
  199. 15.4: Chapter 15 Videos English and Espanol
  200. 16: MATLAB Structures and Data Types
  201. 16.1: Numeric data types
  202. 16.2: Comparing Character Strings
  203. 16.3: table Data Type
  204. 16.4: struct Data Type
  205. 16.4.1: struct Examples and Exercises
  206. 16.5: cell array
  207. 16.6: Chapter 16 Data Types Videos in English and Espanol
  208. 17: Top-Down Design, Agile Software Development, and Object-Oriented Programming in MATLAB
  209. 17.1: Top-Down Design
  210. 17.2: Agile Software Development
  211. 17.3: Object-Oriented Programming, Part 1
  212. 17.4: Object-Oriented Programming, Part 2
  213. 17.5: Chapter 17 Videos in English and Espanol
  214. 18: Integration and Differentiation
  215. 18.1: Integration- Computing the Area Under a Curve
  216. 18.1.1: Problem Set
  217. 18.1.2: The integral() function
  218. 18.2: Numerical Differentiation
  219. 18.3: Chapter 18 Differentiation and Integration Videos in English and Espanol
  220. 19: Ordinary Differential Equations
  221. 19.1: Functions and Files
  222. 19.2: Differential Equations
  223. 19.3: Euler’s Method
  224. 19.4: Implementing Euler’s Method
  225. 19.5: Solving ODEs with ode45
  226. 19.5.1: ODE45 Examples and Exercises
  227. 19.6: Time Dependence
  228. 19.7: What Could Go Wrong?
  229. 19.8: Labeling Axes
  230. 19.9: Chapter Review
  231. 19.10: Chapter 19 ODE Videos in English and Espanol
  232. 19.11: Exercise
  233. 20: Symbolic Processing
  234. Back Matter
  235. Detailed Licensing
  236. MATLAB Functions, Commands and Special Characters
  237. Index
  238. Glossary
  239. Detailed Licensing