changeset 13304:e1524d82f8e0

strtrunc.m: Fix errors in strread, textscan introduced by changeset 86d18a3cc911 * strtrunc.m: Fix errors in strread, textscan introduced by changeset 86d18a3cc911
author Rik <octave@nomad.inbox5.com>
date Sat, 08 Oct 2011 20:14:35 -0700
parents db15303ee267
children 63463570d9fe
files scripts/strings/strtrunc.m
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/strings/strtrunc.m
+++ b/scripts/strings/strtrunc.m
@@ -38,7 +38,7 @@
     ## Convoluted approach converts cellstr to char matrix, trims the character
     ## matrix using indexing, and then converts back to cellstr with mat2cell.
     ## This approach is 24X faster than using cellfun with call to strtrunc
-    idx = cellfun ("size", s, 2) > n;
+    idx = cellfun ("size", s, 2) >= n;
     rows = cellfun ("size", s(idx), 1);
     s(idx) = mat2cell (char (s(idx))(:, 1:n), rows);
   else