- You're using a
'space'
string as a delimiter, which is illegal intextscan
. Specify it as' '
instead. - You want treat consecutive spaces as one, so you should also set the
'MultipleDelimsAsOne'
flag to 1.
The correct syntax should be:
textscan( fid, '%f%s%s%s%s%n', 'delimiter', ' ', 'MultipleDelimsAsOne', 1);
Had you not tried to tinker with the delimiter option, this behavior would've been done properly by default, so just omit all options:
textscan( fid, '%f%s%s%s%s%n');
Also note that you need a flag for each item in the string that is surrounded by spaces. In other words, for a string like this:
-18.151346 Mon Jan 28 11:33:08 2013
the timestamp in string form will be stored in the 5th column of the resulting cell array.