Create a string array by means of a for loop

Hi everyone, I'm implementing the following code:
if true
[num,text,~]=xlsread('C:\Users\giano.rugge\Desktop\forward prices.xlsx',1,'A2:C29')
dates=num2str(cell2mat(text(1:end,2))
temp_matrix=datevec(dates)
new_dates=datestr(temp_matrix)
end
I need to use the built-in function daysdif: it requires as inputs two arrays of strings containing two sets of dates, the first one made up of start dates and the other made up of the respective end dates. The former is represented by new_dates. I would like to know how to build a for loop by which I can create an array of strings each component of which is exactly th last component of the array dates, so that I will have the second input for the function daysdif. Thank you in advance.

Answers (0)

Asked:

on 2 Aug 2016

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!