I have the following code and wish to append the output to an array row by row. Each loop iteration should place the 1st date in Row 1, Column 1 and the first value of R should be placed in Row 1, Column 2. The next iteration will place additional information in the subsequent Row. The number of column entries will be predetermined but the number of Row entries will be indefinite. Please advise.
X = [41334:41340];
Y = [];
exceldate = X;
date = x2mdate(exceldate);
for i=1:1:7
curDate = datestr(date,26);
%Write curDate value to Row i, column 1 of Y
R(i) = i+1;
%Write R(i) value to Row i, column 2 of Y
end
I'm trying to make Y look like:
2013/03/01 2
2013/03/02 3
2013/03/03 4
2013/03/04 5
2013/03/05 6
2013/03/06 7
2013/03/07 8