MATLAB: Parsing file names and converting to numbers

parsingstring manipulationstring to numeric

Hello,
I have a series of bitmap image files each with a velocity as the first 5 characters in the filename (see attached). I seem to be able to isolate the 15.36 from the first file but when I put into a loop in the editor it doesn't like that. Is there a way to parse a filename based on position and write the strings to a numeric variable?
thanks

Best Answer

str2double(filename(1:5))