MATLAB: Financial time series object – how to delete a column

financial time series column indexing by position rather than name / how to elegantly remove nth column in an fts object ?

One might have:
dt =
desc: (none)
freq: Daily (1)
'dates: (2715)' 'times: (2715)' 'Open: (2715)' 'High: (2715)' 'Low: (2715)' 'Close: (2715)' 'Vol: (2715)' 'OI: (2715)'
'19-Mar-2006' '22:00' [ 1164.25] [ 1186.5] [ 1160.5] [ 1183.75] [ 1149131] [ 1064369]
With both a dates and a times column … to remove the times column one could think of:
dt_Close = fints(dt.dates, fts2mat(dt.Close))
This removes the times but gives only one column back … I'd like to keep all columns and remove only the "times" column. So:
Is column indexing by column position (instead of column name) possible? This can be done for rows as:
dt([1 2 3]) % get only first 3 rows
dt([1 3:end]) % skip row 2
as described in another post here …. how can this be done for columns?

Best Answer

It's essentially just a structure so rmfield is implemented as is for a struct object. Ain't the easiest thing to find that out in the documentation, but if you go to the root page and then the 'Functions' link you'll find it...
You can, of course, address the column as
dt.times=[];
to remove the data but there's still an empty field that way.
ADDENDUM
Per the doc, it appears the only way to not have the times series is to pass only a date vector containing no time values...with a series of integer datenum, the first example for fints shows only a dates series.
NB: however, if the data are lacking time information and there are multiple elements for a given day, the internal logic will remove all except the first instance of each day from the resultant time series created--iow, a time series by definition can contain only a single observation at a given time.
So the answer to the question is "you can't" but you can avoid creating the times series initially (in which case you won't have any need to remove it. :) )