Hi I am new to MATLAB and need some help with making a matrix so that I can plot a figure of turnover rates on the NYSE. I have 4 vectors right now, year
, month
, at
and mt
.
They're uploaded from a .csv
in the form of
2010 1 .99 .99
2010 2 .98 .98
2010 3 .99 .98
. . . .
. . . .
2016 4 .99 .99
I'd like to be able to plot at
and mt
versus the dates on the x-axis ascending from Jan 2010 to April 2016. Right now I can plot at
and mt
versus a vector z = 1:76
(as all these vectors are 76x1
) just to represent an increasing x.
If anyone can help that'd be awesome. Thanks.
EDIT: Here's my code thus far
year = data(:,1); %Year (2010, 2011...2016)
month = data(:,2); %Month (1,2,3,etc.)
mt = data(:,3); %NYSE Annualized Monthly Turnover
at = data(:,4); %NYSE Annualized Year to Date Turnover
z = 1:76;
a = plot(z, mt, 'r-', z, at, 'b-');
hold on
legend(a, 'Annualized Monthly Turnover NYSE', 'Annualized Year NYSE')
title('Annualized Monthly & Year-to-Date Turnover of NYSE Securities')
xlabel('Date')
ylabel('Turnover (x100%)')
hold off