next up previous contents
Next: LEGEND Add Legend to Up: Plot Functions Previous: XLABEL Plot X-axis Label   Contents

Subsections

YLABEL Plot Y-axis Label Function

Usage

This command adds a label to the y-axis of the plot. The general syntax for its use is

  ylabel('label')

or in the alternate form

  ylabel 'label'

or simply

  ylabel label

Here label is a string variable.

Example

Here is an example of a simple plot with a label on the y-axis.

--> x = linspace(-1,1);
--> y = cos(2*pi*x);
--> plot(x,y,'r-');
--> ylabel('cost');

which results in the following plot.

8937



Samit K. Basu 2005-03-16