Introduction to Matlab
Course Notes Main Page
This web site contains course notes for a basic introduction to Matlab
Initially this page is really just a list of the topics I want to / have talk(ed) about, without any real coverage here of any particular topic.
- This version of these course notes was modified Summer 2014
by John Bell, for
CS 109 at the University of Illinois Chicago.
- This semester does not require a textbook on Matlab, relying heavily instead on online and built-in documentation.
- Past textbooks include "Essential MATLAB for Engineers and Scientists", Fourth Edition ,by Hahn & Valentine and Introduction to Matlab", Second Edition, by Delores M. Etter. Some of this material may be based loosely on those sources.
Note: Any topic which does not have
a page linked to it, or for which the linked page is unavailable,
is under consideration and/or under development, and is subject
Disclaimer: The following note pages are just that - notes. They serve as reminders to myself of what I want to talk about, but not much more. They do not replace the need for students to take their own notes during class, and they certainly do not replace reading and studying the material in the required textbook.
Course Notes, by Topic, in the order covered ( more or less ):
The Matlab Environment ( IDE )
- Basics of getting, installing, and running Matlab.
- How to get and install a Virtual Private Network
A Simple Sample - Explained line by line.
Getting Started with Matlab
- Survey of the Matlab desktop and capabilities.
- How to save Matlab commands in a script file and run that file.
Creating Matrices with Matlab
- general( who, whos, clear )
- ops( colon, paren, punct, and all Arithmetic except kron )
- elmat( ans, eps, pi, i, inf, nan, disp )
- Valuable commands
- pre-defined variables
- Special Characters
- Mathematical Operators
- Input and Output
- Creating and running scripts
Using Matlab Functions
- elmat( zeros, ones, eye, linspace, logspace, end, magic, peaks )
- ops( colon, paren )
- Direct Entry
- Colon Operator
- Subset or Combination of other arrays
- Using Matlab Functions
- Load from a file
Basic Matrix Operations
- elmat( repmat, size,length, ndims, numel, diag, tril, triu, fliplr, flipud, rot90 )
User Defined Functions
- Relational Operators - >,<,>=,<=,= =, ~ =
- Logical Operators - &, |, ~ for AND, OR, NOT
- if - elseif - else - end
- while and for loops
- Using Matlab to Plot Data from ASCII Files ( Appendix C from C++ book "Engineering Problem Solving with C++", Third Edition, by Etter & Ingber
- Use load to load in the data, : to extract columns ( or other subsets ), and the plotting tools to plot.
Items below this line are under development
Beyond the Scope of These Notes:
- Matrix multiplication, inverse, determinant, solution of equations, Gaussian elimination, etc.
- Simulink and a number of other toolkits available as add-ons.
- Matlab has low-level file I/O operations fopen, fwrite, fread, feof, fseek,and fclose.
- Special Matlab functions exist for reading and writing special format files, such as fprintf, csvread, csvwrite, dlmread,dlmwrite, fgets, fscanf, textread, xlsread, imread, etc.