MATLAB: Data extract

data extract

I have data in a single column in the following format:
123456-123456.123.abcde
I would like to extract 123456 between – and .

Best Answer

str='123456-123456.123.abcde';
num=regexp(str,'-[^\.]*','match');
num=str2double(num{1}(2:end))
Update
a=dir('*.bin');
b={a.name};
c=regexp(b,'-[^\.]*','match');
d=-cellfun(@str2double,c)
d =
200000 200001 200002