MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn moreOpportunities for recent engineering grads.

Apply Today**New to MATLAB?**

Asked by Locks
on 24 Mar 2013

dates=datenum(VIXdate)

y=VIX

plot(dates,y) d=datevec(dates) d=d(:,1) [a,idx]=unique(d)

ylabel('VIX');

set(gca,'xtick',dates(idx),'xticklabel',a)

set(gca,'Box','off')

I have the following code, which shows me a graph with the historic values for a vector called VIX. On the x-axis, I have the years from the vector VIXdate displays, which is working perfectly. The only problem I am facing is, that the dates are displayed for the last day of each year, but I would like to see the date at the point where the first date (01.01) of each year is. How do I have to change the code?

*No products are associated with this question.*

## 3 Comments

## Azzi Abdelmalek

Direct link to this comment:http://www.mathworks.com/matlabcentral/answers/68456#comment_138598

Sven, it was answered in the previous question

I've edited the answer.

## Azzi Abdelmalek

Direct link to this comment:http://www.mathworks.com/matlabcentral/answers/68456#comment_138599

If it's ok, I will delete this question

## Locks

Direct link to this comment:http://www.mathworks.com/matlabcentral/answers/68456#comment_138601

perfect, sorry haven't seen it, but now it's working