I have a cell array of which the last part looks like this:
Columns 8372 through 8375
{'w20091231_2000.nc'} {'w20091231_2020.nc'} {'w20091231_2040.nc'} {'w20091231_2100.nc'}
Columns 8376 through 8379
{'w20091231_2120.nc'} {'w20091231_2140.nc'} {'w20091231_2200.nc'} {'w20091231_2220.nc'}
Columns 8380 through 8383
{'w20091231_2240.nc'} {'w20091231_2300.nc'} {'w20091231_2320.nc'} {'w20091231_2340.nc'}
Columns 8384 through 8387
{'wD1.nc'} {'wD2.nc'} {'wD3.nc'} {'wD4.nc'}
Now I want to rearrange this array so that it only contains the last four strings.{'wD1.nc'} {'wD2.nc'} {'wD3.nc'} {'wD4.nc'}
I tried
IndexC = strfind(names,'wD*.nc');
Index = find(not(cellfun('isempty',IndexC)))
and
Index = find(contains(names,'wD*.nc'));
names2=names(Index)
both work if wD*.nc is wD4.nc but then of course I only select the one value and not the four that I want.
How do I get to use the * ?