comparison scripts/io/textscan.m @ 15263:2136343014d5

bug #37023 (wrong reading of lines starting and/or ending with whitespace) * strread.m: fix regexprep regular expression, test added, improved format specifier parsing * textscan.m: test added
author Philip Nienhuis <prnienhuis@users.sf.net>
date Thu, 30 Aug 2012 20:52:40 +0200
parents 5d3a684236b0
children 6251fa48d28b
comparison
equal deleted inserted replaced
15262:ad1a980b0cb5 15263:2136343014d5
400 400
401 %! Test incomplete first data line 401 %! Test incomplete first data line
402 %! R = textscan (['Empty1' char(10)], 'Empty%d %f'); 402 %! R = textscan (['Empty1' char(10)], 'Empty%d %f');
403 %! assert (R{1}, int32 (1)); 403 %! assert (R{1}, int32 (1));
404 %! assert (isempty (R{2}), true); 404 %! assert (isempty (R{2}), true);
405
406 %% bug #37023 (actually a strread test)
407 %!test
408 %! data = textscan(" 1. 1 \n 2 3\n", '%f %f');
409 %! assert (data{1}, [1; 2], 1e-15);
410 %! assert (data{2}, [1; 3], 1e-15);