Skip to Main Content Skip to Search
Accelerating the pace of engineering and science

 

Training - Courses

MLPR: MATLAB Programming Techniques

This one-day course provides hands-on experience using the features in the MATLAB language to write efficient, robust, and well-organized code. These concepts form the foundation for writing full applications, developing algorithms, and extending built-in MATLAB capabilities. Details of performance optimization, as well as tools for writing, debugging, and profiling code, are covered. Topics include:

  • Programming for robustness
  • Structuring code
  • Structuring data
  • Classes and objects
VIEW SCHEDULE and Register SHARE with Manager/Colleague
 
 Detailed course outline
Day 1 of 1
Programming for Robustness

Objective: Create robust applications that withstand unexpected input and produce meaningful errors. Use built-in MATLAB functions and programming constructs, and employ standard techniques for handling error conditions. Explore tools for debugging code, diagnosing problems, and measuring performance.

  • Warnings and errors
  • Handling errors
  • The try-catch construct
  • The MException object
  • MATLAB Code Analyzer
  • Directory reports
  • MATLAB Debugger
  • Assessing performance
  • MATLAB Profiler
Structuring Code

Objective: Modularize code into readable and maintainable functions. Explore the different function types available in the MATLAB language and the tradeoffs associated with each type. See how function type affects performance and reliability of the code.

  • Private functions
  • Subfunctions
  • Nested functions
  • Function handles
  • Precedence rules
  • Comparison of function types
Structuring Data

Objective: Explore choices for storing data within a MATLAB application and how they affect the application's storage requirements and execution time. Use common techniques for improving performance when storing, accessing, and processing data.

  • Cell arrays
  • Structure arrays
  • Other data containers
  • Preallocation
  • Vectorization
  • Memory management
  • Passing data between functions
Classes and Objects

Objective: Combine data and its associated operations into a custom data type, or class. Write classes and create objects from those classes. Organize large applications using custom classes.

  • Class definition files
  • Properties
  • Property attributes
  • Methods
  • Creating object instances
  • Handle classes
  • Overloading operators
  • Precedence rules

Prerequisites

MATLAB Fundamentals

Course Length - 1 day

Request training