MATLAB: Could anyone help me to plot the graph.

graph

I am using the following lines in my code to plot the graph. code:
xlim([0,25]);
set(gca,'XTick',[0:1:25]);
with respect to xaxis i need to have only 0,1,2,23 (only four numbers)
If i use the above lines in my code it is displayed as
0,1,2,3,……………25.
what should I do inorder to get only 0,1,2,23 in the graph.

Best Answer

set(gca, 'XTick', [0, 1, 2, 23]);