KS: SDC Publications, 2018. — 518 p. [e-book]
This book is designed for undergraduate students completely new to programming with MatLAB. Case studies and examples are used extensively throughout this book and are at the core of what makes this book so unique. The author believes that the best way to learn MatLAB is to study programs written by experienced programmers and that the quality of these example programs determines the quality of the book. The examples in this book are carefully designed to teach you MatLAB programming as well as to inspire within you your own problem solving potential. Most of the examples used in this book are designed to solve a whole class of problems, rather than a single, specific problem.
A learn by doing teaching approach is used all through the book. You are guided to tackle a problem using MatLAB commands first and then the commands are explained line by line. This process of learning through hands on experience is one of the most efficient and pain-free ways of learning MatLAB. This approach, together with the extensive use of ordered textboxes, figures, and tables, greatly reduces the size of the book, while still providing you with a book that s comprehensive and easy to follow.
Who this book is forThis book is developed mainly for undergraduate engineering students. It may be used in courses such as Computers in Engineering, or others that use MatLAB as a software platform. It can also be used as a self-study book for learning MatLAB.
College level engineering examples are used in this book. Background knowledge for these engineering examples is illustrated as thoroughly as possible.
Getting Started, Desktop Environment, and OverviewStart and Quit MatLAB
Entering Commands
Array Expressions
Data Visualization: Line Plots
MatLAB Scripts
Data Visualization: Surface Plots
Symbolic Mathematics
Live Script Editor
Screen Text Input / Output
Text File Input / Output
Debug Your Programs
Binary File Input / Output
Images and Sounds
Flow Controls
User-Defined Functions
Cell Arrays
Structures
Graphical User Interfaces (GUI)
GUIDEApp Designer
Data Types, Operators, and ExpressionsUnsigned Integers
Signed Integers
Floating-Point Numbers
Character and Strings
Logical Data
Arrays
Sums, Products, Minima, and Maxima
Arithmetic Operators
Relational and Logical Operators
String Manipulations
Expressions
Example: Function Approximations
Example: Series Solution of a Laplace Equation
Example: Deflection of Beams
Example: Vibrations of Supported Machines
Additional Exercise Problems
Flow Controls, Functions, and ProgramsIf-Blocks
Switch-Blocks
While-Loops
For-Loops
User-Defined Functions
Subfunctions
Nested Functions
Function Handles
Anonymous Functions
Function Precedence Order
Program Files
Example: Deflection of Beams
Example: Sorting and Searching
Example: Statically Determinate Trusses (Version 1.0)
Example: Statically Determinate Trusses (Version 2.0)
Additional Exercise Problems
Cell Arrays, Structures, Tables, and User-Defined ClassesCell Arrays
Functions of Variable-Length Arguments
Structures
Example: Statically Determinate Trusses (Version 3.0)
Tables
Conversion of Cell Arrays
Conversion of Structure Arrays
Conversion of Tables
User-Defined Classes
Additional Exercise Problems
Data Visualization: PlotsGraphics Objects and Parent-Children Relationship
Graphics Objects Properties
Figure Objects
Axes Objects
Line Objects
Text Objects
Legend Objects
Bar Plots
Pie Plots
3-D Line Plots
Surface and Mesh Plots
Contour Plots
Vector Plots
Streamline Plots
Isosurface Plots
Additional Exercise Problems
Animations, Images, Audios, and VideosAnimation of Line Plots: Comet
Stream Particles Animations
Movie: Animation of an Engine
Indexed Images
True Color Images
Audios
Videos
Example: Statically Determinate Trusses (Version 4.0)
Additional Exercise Problems
Data Import and ExportScreen Text I/O
Low-Level Text File I/O
Low-Level Binary File I/O
MAT-Files
ASCII-Delimited Files
Excel Spreadsheet Files
Additional Exercise Problems
Graphical User InterfacesPredefined Dialog Boxes
UI-Controls: Pushbuttons
Example: Image Viewer
UI-Menus: Image Viewer
Panels, Button Groups, and More UI-Controls
UI-Controls: Sliders
UI-Tables: Truss Data
Example: Statically Determinate Trusses (Version 5.0)
GUIDEApp Designer
Additional Exercise Problems
Symbolic MathematicsSymbolic Numbers, Variables, Functions, and Expressions
Simplification of Expressions
Symbolic Differentiation: Curvature of a Planar Curve
Symbolic Integration: Normal Distributions
Limits
Taylor Series
Algebraic Equations
Inverse of Matrix: Hooke's Law
Ordinary Differential Equations (ODE)
Additional Exercise Problems
Linear Algebra, Polynomial, Curve Fitting, and InterpolationProducts of Vectors
Systems of Linear Equations
Backslash Operator (\)
Eigenvalue Problems
Polynomials
Polynomial Curve Fittings
Interactive Curve-Fitting Tools
Linear Fit Through Origin: Brake Assembly
Interpolations
Two-Dimensional Interpolations
Differentiation, Integration, and Differential EquationsNumerical Differentiation
Numerical Integration: trapz
Length of a Curve
User-Defined Function as Input Argument: integral
Area and Centroid
Placing Weight on Spring Scale
Double Integral: Volume Under Stadium Dome
Initial Value Problems
IVP: Placing Weight on Spring Scale
ODE-BVP: Deflection of Beams
IBVP: Heat Conduction in a Wall
Nonlinear Equations and OptimizationNonlinear Equations: Intersection of Two Curves
Kinematics of Four-Bar Linkage
Asymmetrical Two-Spring System
Linear Programming: Diet Problem
Mixed-Integer Linear Programming
Unconstrained Single-Variable Optimization
Unconstrained Multivariate Optimization
Multivariate Linear Regression
Non-Polynomial Curve Fitting
Constrained Optimization