clear all, close all
x = linspace(0,2*pi,100);
y = sin(x);

figure, plot(x,y)
figure, plot(x,y)

a = gca;
xt = get(a,'XTick');
yt = get(a,'Ytick');

xtNew = linspace(xt(1),xt(end),5);
ytNew = linspace(yt(1),yt(end),5);

set(a,'Xtick',xtNew);
set(a,'Ytick',ytNew);