MATLAB: How to filter only numerical in a table

numerical valuestable

I have data organized in a column in a table like this:
'1966.csv'
'1967.csv'
'1968.csv'
'1969.csv'
'1970.csv'
'1971.csv'
'1972.csv'
'1973.csv'
'1974.csv'
'1975.csv'
How could I only extract the numerical values (1966, 1967…) and organize them in a column beside the existing one?

Best Answer

s={'1966.csv' '1967.csv' '1968.csv' '1969.csv' '1970.csv' '1971.csv' '1972.csv' '1973.csv' '1974.csv' '1975.csv'}
out=cellfun(@(x) str2double(regexp(x,'\d+','match')),s)