
Continue your Matlab learning with part 2, covering functions and programs, strings, advanced functions, and advanced mathematics, with slides, example problems, practical Matlab practice, and quizzes to test mastery.
Learn to create MATLAB functions with multiple outputs and call them from scripts, including header definitions, row-vector output, and examples like calculating a circle's area and circumference.
Explore MATLAB dynamics and statics with multi-output functions. Analyze ship displacement and velocity over time and plot results; determine distance, unit vector, and direction angles between two points.
Vectorize MATLAB code to replace nested loops with a single line and operate on matrices; create a function with multiple outputs to compute area and perimeter from base and height.
Master MATLAB functions, including no-input and no-output variants, subfunctions, and modular programs that load data, perform calculations, and plot results via clean, named function calls.
Learn to create a MATLAB function with no output and plot cosine and sine on a figure; build statics program using unit vectors and system solve to compute cable forces.
Demonstrate a modular MATLAB program for an airfoil flow, solving the ideal gas law and isotopic flow and energy balance equations, then plot pressure, temperature, and velocity at point two.
Use persistent variables to retain values between function calls, avoiding repeated input or output arguments. Initialize by checking is empty, and reset with clear functions to implement a simple counter.
Explore MATLAB with persistent and global variables through two examples: a running average using a persistent sum and value count, and a global gravity constant shared by scripts and functions.
Learn to work with strings and characters in MATLAB, including creating text with single quotes, indexing and substrings, and horizontally or vertically concatenating while handling leading and trailing blanks.
Explore two methods for creating and manipulating character matrices in MATLAB, including vertical and horizontal concatenation, using square brackets versus the character matrix function, with indexing and trailing spaces.
Learn to create dynamic strings with sprintf in MATLAB, replacing values in prompts, titles, and labels to reflect changing variables like state, city, and velocity.
Learn to use MATLAB printf-style formatting to create dynamic plot titles for an underdamped second-order response, displaying overshoot and time range updates as you plot C(t) versus time.
Load a two-column data file in MATLAB, plot time versus position with a user-specified color, and generate a dynamic title showing min time, max time, and max displacement.
Learn MATLAB string functions for engineering students, including deblank, strtrim, and blanks for spacing, and upper and lower for case conversion, plus string compare and ignore-case variants.
Explore string comparison in MATLAB by comparing the first three characters of three similar strings using string in compare and string compare, with and without ignoring case.
Master string find and string replace in MATLAB to locate patterns and substitute substrings, then use ls with a wildcard and a for loop to batch load multiple data files.
Use MATLAB string find, isempty, and string replace to convert engineering course prefixes to arrow, then load multiple data files with a for loop and plot time versus velocity.
Learn MATLAB string token splitting and eval usage for executing string-based code. Identify isletter, isspace, ischar, and convert between int to string, numb to string, and string to number.
Create two-function plots in MATLAB by selecting from cosine, sine, log, and square root, choosing colors, and using string concatenation and eval to generate the plotted equations.
This quiz guides applying the ideal gas law in MATLAB by building a function, prompting for a gas name, mapping to R, and computing temperature in kelvin.
Explore anonymous functions in MATLAB, learn to create simple one-line functions within scripts, use function handles, pass functions to other functions, and handle variable input and output arguments.
Explore anonymous functions in MATLAB by squaring inputs with element-wise operations, and compute final grades from grades data while plotting three equations in a 1-by-3 subplot.
learn to approximate definite integrals using the trapezoid rule in MATLAB, implementing anonymous functions and string-based user input.
Learn function functions and function handles in MATLAB, using function handles with the at symbol to pass functions, create dummy names, and plot an imported function via a user defined example.
This lecture demonstrates solving a root with Matlab’s f0 Newton-Raphson, using anonymous functions and function handles, and verifying results by re-evaluating the function and plotting for good initial guesses.
Use fplot with function handles to quickly plot y = f(x) over a chosen range and save workspaces with .mat files for later use of anonymous functions.
Develop anonymous temperature conversion functions in MATLAB (kelvin to celsius, rankine to fahrenheit, celsius to fahrenheit) and save them to a .mat file for reuse with fplot 0 to 8.
Master variable input and output functions in MATLAB by using cell arrays and varargin/varargout to handle optional arguments, with nargin guiding dynamic calculations.
Explains using variable output arguments in MATLAB functions to return mean and optional standard deviation for grade arrays, using varargout, cell arrays, and nargout to handle one or two outputs.
Explore variable input and output in MATLAB via examples: plotting a first-order response with optional color, converting yards to meters or miles, and a rectangle function returning area and volume.
Create seven colorful parametric plots in MATLAB using a for loop, t from 0 to 200 in 0.5 steps, x=cos(t) and y=sin(t) scaled by a sign function, with optional title.
Explore MATLAB variable output functions by computing the position vector and magnitude from two points, with a unit vector controlled by a menu prompt, using var out and fprintf formatting.
Explore how MATLAB represents polynomials as coefficient row vectors, determines order by coefficient count, and uses polyVal and roots to evaluate and find roots.
Explore constructing and evaluating polynomials in MATLAB using coefficient vectors, the roots function, and the polyval function to generate and plot data.
Apply curve fitting and interpolation in MATLAB to estimate missing data and extrapolate from tabular experiments using polyfit and polyval, with examples from time-velocity data and steam tables.
Learn curve fitting in MATLAB using polyfit and polyval on projectile data, plus interpolation for altitude temperature and pressure with linear and spline methods.
Load the response data, perform a sixth-order polyfit of time versus displacement, and plot the estimated curve against the actual data; then adjust the polynomial order to improve the fit.
Explore complex numbers in Matlab, representing z as a+bi or a+bj, and using complex, real, imag, conj, display, fprintf, and isreal.
Use MATLAB to find complex roots of a polynomial with the roots function, separate real and imaginary parts, and illustrate complex conjugates and formatting with fprintf.
Explore symbolic expressions in matlab, creating and manipulating symbols to perform algebraic simplifications, with multi-symbol declarations and conversions between symbolic and numeric polynomials.
Learn to create and manipulate symbolic expressions in Matlab using x, y, and z; pause, clear, and explore symbol-based equations, including converting to numeric polynomials.
Explore MATLAB symbolic functions like simplify, collect, expand, and factor to perform algebra on symbolic expressions, then use subs, num/den, pretty, and easy plot.
Explore creating and simplifying symbolic MATLAB expressions with syms, using simplify and expand, and substitute values with subs; then plot symbolic results and build C(T) equations via for loops.
Create a symbolic expression and separate the numerator and denominator with a function. Substitute x and B with 6 and 3 using subs, reconstruct t, and view symbolic and pretty.
Master MATLAB integration and differentiation techniques for engineering, using trapz and quad for numerical integration, and poly int and symbolic diff and int for polynomials and definite or indefinite integrals.
Apply MATLAB to estimate drag from a car’s cross-sectional area using numerical integration and a second-order polynomial. Compute the area under the curve with symbolic integration and compare Simpson’s method.
Explore how to compute definite and indefinite integrals in MATLAB using trapezoidal and Simpson methods, and symbolic integration, with an anonymous function, array handling, and type conversion to numeric results.
Explore how to compute mean, variance, and standard deviation with MATLAB on a vector, and use mode and median to summarize data distributions.
Compare two weeks of furnace temperature data by plotting each week and computing variance, mean, mode, and median, with a horizontal mean line for clear comparison in MATLAB.
Welcome!
MATLAB for Engineering Students Part 2 is a continuation of my MATLAB for Engineering Students course. This class will enhance your MATLAB skills and allow you to write more efficient and complicated code. We will cover several different types of user defined functions, strings and math topics.
Here's what you'll learn:
User-defined functions with multiple outputs
Subfunctions
Persistent Variables
String concepts (concatenation, sprintf, eval & more)
Anonymous functions
Function functions & function handles
Variable input & variable output functions (varargin & varargout)
Polynomials
Curve fitting with polynomials
Symbolic expressions
Integration & differentiation
and more!
What you get when you enroll:
Downloadable slides and examples are provided in pdf form for each section
10 hours of on demand lecture videos
10 downloadable quizzes with video solutions in case you get stuck
This course assumes you have knowledge of the following MATLAB concepts:
Matrices
if Statements
Looping (for, nested, while)
2-D plotting
User-defined functions with one output
fprintf
load & save functions
Enhance your MATLAB skills today! Enroll now!