I built a 7647×2 Table with Variables "td" for Trading week-day and "close" for the closing prices of the Swiss Market Index, where td is Categorical and close Double
The Market is open only from Monday to Friday, but the td variable summary displays some "Sunday" observation. I checked on the Calendar and those are actually either Mondays or Fridays.
Is there I way I can replace all Sundays with the appropriate Day? I tried with the following:
for i = 1:length(td);
for td(i) == 'Sunday';
if td(i+1) == 'Monday'
td(i) == 'Friday'
elseif td(i+1) == 'Tuesday'
td(i) == 'Monday'
But I am a mess with for loops and if statements and I am not really sure how to use them with categorical variables
Anyone could help?