>> x = 0:pi/30:2*pi; % x vector, 0 <= x <= 2*pi, increments of pi/30
>> y = sin(3*x); % vector of y values
>> plot(x,y) % create the plot
>> xlabel('x (radians)'); % label the x-axis
>> ylabel('sine function'); % label the y-axis
>> title('sin(3*x)'); % put a title on the plot
The effect of the labeling commands, xlabel, ylabel, and title are indicated by the text and red arrows in the figure. Don't skimp on the labels!

0 comments