MATLAB ylabel

The ylabel command put the label on the y-axis of the plot, after reading this MATLAB ylabel topic, you will know the theory, and examples, and you will understand how to use it in MATLAB.


Syntax:

ylabel(‘text as string’)

Example:

The statement to plot a sine wave in MATLAB is given as

x=0:0.1:2*pi; 
y=sin(x); 
plot(x,y)

Output:

Adding y-axis label “amplitude”, to the plot,

x=0:0.1:2*pi; 
y=sin(x); 
plot(x,y) 
ylabel('amplitude')

Output:

Published by

Electrical Workbook

We provide tutoring in Electrical Engineering.

Leave a Reply

Your email address will not be published. Required fields are marked *