%% Include Variable Value in Axis Label
% Include a variable value in the _x_-axis label. Use the |num2str|
% function to convert the number to a string.

% Copyright 2015 The MathWorks, Inc.


x = linspace(0,10);
amp = 2;
y = amp*cos(x);
plot(x,y)
xlabel(['Sine wave: ' num2str(amp) ' units in amplitude.'])
