Hello,
I understand that you want to convert the dates stored in 'day_of_year' to its string format and then store it in 'result'. In that case, you can do the following:
for Date = 1:652
Location = day_of_year(Date);
Real_Date = datestr(Location);
Result{Date} = Real_Date;
end
P_Year{year,:} = Result;
Note that 'Real_Date' is an array of strings (each character is stored as a separate element). So in order to copy each date as a single element in 'Result', you will need to define 'Result' as a cell array. To access the data in a cell array , you can use curly parenthesis.
I hope this helps,
Ghada