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

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

% Copyright 2012 The MathWorks, Inc.