# HG changeset patch # User Philip Nienhuis # Date 1404478438 -7200 # Node ID d69358d7f9bb21097726f40b0d894da2f7aede48 # Parent 96751a74bbbb31f15597c48687d8465dc2036f2d textscan.m: Avoid conjugate transpose for complex data and empty format string (bug #42528) diff -r 96751a74bbbb -r d69358d7f9bb scripts/io/textscan.m --- a/scripts/io/textscan.m Tue Aug 12 15:27:16 2014 -0400 +++ b/scripts/io/textscan.m Fri Jul 04 14:53:58 2014 +0200 @@ -329,7 +329,7 @@ ## Compute nr. of rows nrows = floor (numel (C{1}) / ncols); ## Reshape C; watch out, transpose needed - C(1) = reshape (C{1}, ncols, numel (C{1}) / ncols)'; + C(1) = reshape (C{1}, ncols, numel (C{1}) / ncols).'; ## Distribute columns over C and wipe cols 2:end of C{1} for ii=2:ncols C(ii) = C{1}(:, ii); @@ -677,3 +677,7 @@ %! a = textscan (",1,,4\nInf, ,NaN", "", "delimiter", ",", "emptyvalue", -10); %! assert (cell2mat (a), [-10, 1, -10, 4; Inf, -10, NaN, -10]); +%% Bug #42528 +%!test +%! assert (textscan ("1i", ""){1}, 0+1i); +%! assert (cell2mat (textscan ("3, 2-4i, NaN\n -i, 1, 23.4+2.2i", "")), [3+0i, 2-4i, NaN+0i; 0-i, 1+0i, 23.4+2.2i]);