# HG changeset patch # User Rik # Date 1318130075 25200 # Node ID e1524d82f8e0a12215d49dcf5324e90e34605af2 # Parent db15303ee267b9e389941cad7ddfe63d72e08e6c strtrunc.m: Fix errors in strread, textscan introduced by changeset 86d18a3cc911 * strtrunc.m: Fix errors in strread, textscan introduced by changeset 86d18a3cc911 diff --git a/scripts/strings/strtrunc.m b/scripts/strings/strtrunc.m --- 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