Programming and Graphics

(Kiana) #1

356 Introduction to C++ Programming and Graphics


Function Purpose

cat Concatenate arrays
cond Condition number of a matrix
det Matrix determinant
eig Matrix eigenvalues and eigenvectors
inv Matrix inverse
lu LU-decomposition of a matrix
ode23 Solution of ordinary differential equations
by the second/third-order Runge-Kutta method
ode45 Solution of ordinary differential equations
by the fourth/fifth-order Runge-Kutta-Fehlberg method
qr QR-decomposition of a matrix,
whereQis an orthogonal matrix andR
is an upper triangular (right) matrix
poly Characteristic polynomial of a matrix
quad Function integration by Simpson’s rule
root Polynomial root finder
svd Singular-value decomposition
trapz Function integration by the trapezoidal rule

x=A\b Solves the linear systemA·x=b,
whereAis anN×Nmatrix,
andb,xareN-dimensional column vectors
x=b/A Solves the linear systemx·A=b,
whereAis anN×Nmatrix,
andb,xareN-dimensional row vectors

Table F.7.1A partial list of general-purpose numerical methodsMatlabfunc-
tions.



  • To generate a new graphics window, use the command:figure

  • To produce a graphics file, use theexportorsaveoption under thefile
    pull-down menu in the figure window.

  • To manipulate axis properties, use the commandaxisand its options.

  • To superimpose graphs, use the commandhold.

  • To close a graphics window, use the commandclose.


In the remainder of this section, we present several graphics sessions
followed by the graphics output.

Free download pdf