I have got the following problem. I have several subplots within one figure, that are created in a loop. I want to get rid of the X axis labels on all of them, except for the last subplot in a loop. How can I do that? Here is what I tried.
for i=1:1:10figure(1);s(i)=subplot(10,1,i)t=1:1440;y=sin(t); %for instance
plot(t,y);ax=gca;if s(i)~=s(10)set(ax,'XTick', []);elseax.XAxis.TickValues =0:60:1440;ax.XAxis.MinorTick='on';ax.XAxis.MinorTickValues=0:60:1440;grid on;ax.XMinorGrid='on';endend
This, actually, does not work. All the X labels are still there. Could you please help me to do that?
Best Answer