O'Reilly logo

Learning to Program with MATLAB: Building GUI Tools by Craig S. Lent

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

images

13.1    Logarithmic plots

13.2    Plotting functions on two axes

13.3    Plotting surfaces

13.4    Plotting vector fields

13.5    Working with images

13.6    Rotating composite objects in three dimensions

This chapter is meant to be a first reference and source of examples for creating some of the more complex graphical visualizations that MATLAB enables. The scope ranges from simple plotting commands to manipulation of aggregate graphical objects in three dimensions.

Log plots. Section 12.1 describes the facilities for making various log and semi-log plots. The key MATLAB commands are semilogy, semilogx, loglog, and logspace.

Plotting functions on two axes. It is sometimes helpful to plot two functions of the same independent variable on one graph, even though the functions have different units. The solution, described in Section 12.2, is to have different vertical axes on the left and right of the graph. This is accomplished using the plotyy command.

Plotting surfaces in three dimensions. A function of two variables, f(x, y), can be visualized as a surface over the xy–plane. Section 13.3 describes using the surf, surfl, mesh, and meshgrid commands used to create surfaces in three dimensions. Two-dimensional pseudocolor plots, using pcolor, and contour plots, using contour, are visualization alternatives.

Plotting vector fields. A vector-valued function of two or three variables ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required