6.7. Specialized Two-Dimensional Plots

Besides drawing plots using plot command, there are many specialized graphics functions in MATLAB for 2-D plotting. Some of the specialized 2-D plot functions are discussed in the following section.

6.7.1. Logarithmic Plot Function

These are further classified as

  1. semilogx: It plots with logarithmically spaced x-axis.

  2. semilogy: It plots with logarithmically spaced y-axis.

  3. loglog: It plots with both the axes logarithmically spaced.

6.7.1.1. semilogx

In semilogx command, the x-axis is drawn on logarithmic scale and y-axis on linear scale. The syntax is

semilogx(x,y)

where

x is the vector of x-variables, and

y is the vector of y-variables.

Example 6.14.

Plot function x= e-a, y = a2 where 0<=a<=10, using

Get MATLAB® and Its Applications in Engineering: [Based on MATLAB 7.5 (R2007b)] now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.