a=[1 2 7 5 4 6]
t=0:2:10
plot(t,a);

I want that in the plot on x axis only values : 0, 2, 4, 6, 8, 10 (as per t=0:2:10 in the code) should be depicted on the time axis unlike the above which shows all values. How do I do this ?
Those are the xticks, set them like this:
set(gca,'Xtick',0:2:10);
If you want to hide the yticks:
set(gca,'Ytick',[]);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With