%% Change Tick Value Locations and Labels
% Create x as 200 linearly spaced values between -10 and 10. Create y as the cosine of x. Plot the data.

x = linspace(-10,10,200);
y = cos(x);
plot(x,y)

%
% Change the tick value locations along the x-axis and y-axis. Specify the locations as a vector of increasing values. The values do not need to be evenly spaced.
% Also, change the labels associated with each tick value along the x-axis. Specify the labels using a cell array of character vectors. To include special characters or Greek letters in the labels, use TeX markup, such as \pi for the \pi symbol.

xticks([-3*pi -2*pi -pi 0 pi 2*pi 3*pi])
xticklabels({'-3\pi','-2\pi','-\pi','0','\pi','2\pi','3\pi'})
yticks([-1 -0.8 -0.2 0 0.2 0.8 1])

% For releases prior to R2016b, instead set the tick values and labels using the XTick, XTickLabel, YTick, and YTickLabel properties of the Axes object. For example, assign the Axes object to a variable, such as ax = gca. Then set the XTick property using dot notation, such as ax.XTick = [-3*pi -2*pi -pi 0 pi 2*pi 3*pi]. For releases prior to R2014b, use the set function to set the property instead.
% Copyright 2012 The MathWorks, Inc.