>> figure
>> box on
>>
>>
>> startDate = 7.3457e+05;
>> endDate = 7.3458e+05;
>> numbertick = ceil(endDate - startDate);
>>
>>
>> xData = linspace(startDate, endDate, numbertick);
>> plot(xData,ones(size(xData)));
>>
>>
>> set(gca, 'XTick',xData)
>> set(gca, 'TickDir', 'out');
>> set(gca, 'XTickLabelMode', 'auto');
>>
>>
>> labels = get(gca, 'XTickLabel');
>>
>> for i = 1:length(labels)
>> if i == 1 || i == ceil(length(labels)/2) || i == length(labels)
>> labels{i} = datestr(xData(i), 'mm/dd');
>> else
>> labels{i} = '';
>> end
>> end
>>
>> set(gca, 'XTickLabel', labels)
Best Answer