# Exam #3 Review: Comprehensive Exam Class 14.2 Palm Matlab Book Ch. 1-5.

## Presentation on theme: "Exam #3 Review: Comprehensive Exam Class 14.2 Palm Matlab Book Ch. 1-5."— Presentation transcript:

Exam #3 Review: Comprehensive Exam Class 14.2 Palm Matlab Book Ch. 1-5

Exam #3: Comprehensive Exam Thursday, December 2, 2004 6:30 - 8:00 pm Bright 124 Bring:  Pencil, calculator, and graphics pack Turn in:  Completed group project and team evaluation form (separately).

Chapter 1: Matlab file commands and command window management Order of operations On-line help Matlab editor  Comments  Legal file names  Difference between script and function files

Chapter 2: Arrays (creation, indexing, editing)  find(), linspace(), max(), min(), size(), sort(), sum() Array operations or element-by-element operations (.*,./,.^, +, -) Matrix operations  Multiplication, addition, subtraction, coefficients  cross(), dot() Polynomial commands  conv(), deconv(), poly(), polyval(), roots()

Chapter 2, continued: Cell arrays  Know two methods for creating/editing data  Store mixed data types Structure arrays  Data structure with named fields  structure(rec_num).field

Chapter 3: Built-in math functions  exp(), sqrt(), log(), log10(), cos(), sin()  fzero(), fminsearch() Importing data

Chapter 3, continued: User-defined functions:  function [outputs] = f_name(inputs) Store as f_name.m Use as in:  >> [outputs] = f_name(inputs) Variables in function are local (deleted after function finishes) unless defined as global

Chapter 4: Relational operators  >, =, <=, ==, ~= Logical operators  ~, &, &&, |, ||, xor() Order of operations  (), ^ * /, + -, > < …, &, |

Chapter 4, continued: If – structure if logical 1 Block 1 elseif logical 2 Block 2 else Block 3 end

Chapter 4, continued: Switch – structure Switch switch_var Case value 1 Block 1 Case value 2 Block 2 Otherwise Block 3 end

Chapter 4, continued: For – loops for loop_var = m:s:n Block Loop_var = … % NOT ALLOWED A(loop_var) = … % ALLOWED … = Loop_var … % ALLOWED end

Chapter 4, continued: While – loops While logical statement Block Something that changes logical statement end

Chapter 4, continued: Flow control commands  break, continue

Chapter 5: Basic plotting commands  plot(), axis(), xlabel(), ylabel(), title(), text()  grid on, hold on, grid off, hold off Different plot types  plot(), loglog(), semilogy(), semilogx() Different symbol types  ‘bo-’, ‘o--’, ‘.-’, ‘b’, ‘o’, etc.

Chapter 5, continued: Three-dimensional plots  mesh(), surf(), contour(), plot3() [x, y] = meshgrid(x, y) Z = x.*x, etc.

Chapter 5, continued: Linear, power, and exponential functions Polynomial fitting  polyfit(), polyval() Linear regression  y/x, etc. Plotting multiple plots in a single figure  subplot, hold

Any questions?

Download ppt "Exam #3 Review: Comprehensive Exam Class 14.2 Palm Matlab Book Ch. 1-5."

Similar presentations