EEE321L Lecture
EEE321L Lecture
&
Functions
4. Plotting Commands
4.1 Basic xy Plotting Commands
4.2 Plot Enhancement Commands
4.3 Specialized Plot Commands
4.4 Colors, Symbols and Line Types
4.5 Three-Dimensional Plotting Commands
4.6 Histogram Functions
4.7 MATLAB Commands–2
5. Programming
5.1 Logical and Relational Operators
5.2 Program Flow Control
5.3 Logical Functions
5.4 M-Files
5.5 Timing
6. Mathematical Functions
6.1 Exponential and Logarithmic Functions
6.2 Trigonometric Functions
6.3 Hyperbolic Functions
6.4 Complex Functions
6.5 Statistical Functions
6.6 Random Number Functions
6.7 Numeric Functions
6.8 String Functions
7. Numerical Methods
7.1 Polynomial and Regression Functions
7.2 Interpolation Functions
7.3 Numerical Integration Functions
7.4 Numerical Differentiation Functions
7.5 ODE Solvers
7.6 Predefined Input Functions
Plotting Commands
Basic xy Plotting Commands
axis Sets axis limits.
fplot Intelligent plotting of functions.
grid Displays gridlines.
plot Generates xy plot.
print Prints plot or saves plot to a file
title Puts text at top of plot.
xlabel Adds text label to x-axis.
ylabel Adds text label to y-axis.
Plot Enhancement Commands
axes Creates axes objects.
close Closes the current plot.
close all Closes all plots.
figure Opens a new figure window.
gtext Enables label placement by mouse.
hold Freezes current plot.
legend Legend placement by mouse.
refresh Redraws current figure window.
set Specifies properties of objects such as axes.
subplot Creates plots in subwindows.
text Places string in figure.
Specialized Plot Commands
bar Creates bar chart.
Programming
Logical and Relational Operators
== Relational operator: equal to.
~= Relational operator: not equal to.
< Relational operator: less than.
<= Relational operator: less than or equal to.
> Relational operator: greater than.
>= Relational operator: greater than or equal to.
& Logical operator: AND.
| Logical operator: OR.
~ Logical operator: NOT.
xor Logical operator: EXCLUSIVE OR.
Program Flow Control
break Terminates execution of a loop.
case Provides alternate execution paths within switch structure.
Mathematical Functions
Exponential and Logarithmic Functions
exp(x) Exponential; ex.
Numerical Methods
Polynomial and Regression Functions
conv Computes product of two polynomials
deconv Computes ratio of polynomials.
eig Computes the eigenvalues of a matrix.
poly Computes polynomial from roots.
polyfit Fits a polynomial to data.
polyval Evaluates polynomial and generates error estimates.
roots Computes polynomial roots.
Interpolation Functions
interp1 Linear and cubic-spline interpolations of a function of one variable.
interp2 Linear interpolation of a function of two variables.
spline Cubic-spline interpolation.
unmkpp Computes the coefficients of cubic-spine polynomials.
Root Finding and Minimization
fmin Finds minimum of single-variable function.
fmins Finds minimum of multivariable function.
fzero Finds zero of single-variable function.
Numerical Integration Functions
quad Numerical integration with adaptive Simpson’s rule.
quadl Numerical integration with adaptive Lobatto quadrature.