Graphics Reference
In-Depth Information
Chapter 2
Two-Dimensional Graphics. Statistics
Graphics and Curves in Explicit,
Parametric and Polar Coordinates
MATLAB allows the representation of any mathematical function, even if it is defined piecewise or jumps to infinity in
its field of definition. MATLAB makes graphs of planar (two-dimensional) curves and surfaces (three-dimensional),
groups them and can overlap them. You can combine colors, grids, frames, etc., in the graphics. MATLAB allows
representations of functions in implicit, explicit and parametric coordinates, and is without a doubt mathematical
software with high graphics performance. One of their differences with the rest of the symbolic calculation packages is
that “animations” can be generated by combining different graphics with slight variations from each other displayed
quickly in succession, to give the impression of movement generated from graphs similarly to moving pictures and
cartoons.
In addition, MATLAB also allows for typical bar graphs, lines, star graphs and histograms. It also offers special
possibilities of representation of polyhedra with geographical maps. In handling of graphics, it is very important to
bear in mind the availability of memory on the computer. The graphics drawings consume lots of memory and require
high screen resolution.
2.1 Two-Dimensional Graphics (2-D)
The basic commands that MATLAB uses to draw the graph of a function of a variable are as follows:
plot(X,Y) draws the set of points (X, Y) , where X and Y are row vectors. For graphing a
function y = f (x) , it is necessary to know a set of points (X, f (X)) , to set a range of variation
for the vector X. X and Y can be matrices of the same size, in which case a graph is made
by plotting each pair of rows and on the same axis. For complex values of X and Y , the
imaginary parts are ignored.
plot (Y) draws the vector Y elements, i.e., gives the graph of the set of points (t, Y t ) for
t = 1, 2,… n where n = length (Y). It is useful for graphing time series. If Y is a matrix, plot (Y)
makes a graph for each column Y presenting all on the same axis. If the components of the
vector are complex, plot (Y) is equivalent to plot (real (Y), imag (Y)).
 
Search WWH ::




Custom Search