MATLAB: How to change vaules on X axis on a plot

axisMATLABplotxtick

Hello everyone, I am struggling with changing the values on the X axis in Matlab's plot. I just need to divide the values on the x axis by 10, however, I need to do it somehow automated, because the values may differ, it won't be always like as it is shown in attached plot. I've tried with XTickLabel function, however, I didn't succeed. I would appreciate some help.
Thank you.

Best Answer

Try this:
x = 0:1300; % Create Data

y = -2.1*x; % Create Data
figure(1)
plot(x, y)
xt = get(gca, 'XTick');
set(gca, 'XTick',xt, 'XTickLabel',xt/10)