Applications

Other

Matlab Plot
- stem

In this example, we study the 'stem'
instruction to plot Matlab
functions.

It draws vertical lines (with a
little circle at the tip)
proportional to
the value of the function at that particular horizontal value. 'stem' does not
join
the circles with a line, and it is very helpful to stress the fact that
the
function is
not
continuous but discrete.

Let's assume that we want to plot the following elegant exponential and
sinusoidal function:

Example:
let's draw a simple discrete function

We can develop a script like this:

%
Avoid superimposed operations and close previous figs.clc;
clear; close all