From: <cde...@us...> - 2012-03-13 21:57:35
|
Revision: 9870 http://octave.svn.sourceforge.net/octave/?rev=9870&view=rev Author: cdemills Date: 2012-03-13 21:57:28 +0000 (Tue, 13 Mar 2012) Log Message: ----------- Ensure cells with strings and number are all converted to number Modified Paths: -------------- trunk/octave-forge/extra/dataframe/inst/@dataframe/private/df_matassign.m Modified: trunk/octave-forge/extra/dataframe/inst/@dataframe/private/df_matassign.m =================================================================== --- trunk/octave-forge/extra/dataframe/inst/@dataframe/private/df_matassign.m 2012-03-13 21:50:39 UTC (rev 9869) +++ trunk/octave-forge/extra/dataframe/inst/@dataframe/private/df_matassign.m 2012-03-13 21:57:28 UTC (rev 9870) @@ -320,7 +320,8 @@ if (size (RHS, 1) <= 1) switch df._type{indc(indi)} case {'char' } %# use a cell array to hold strings - dummy = RHS(:, indj); + dummy = cellfun (@num2str, RHS(:, indj), \ + 'UniformOutput', false); case {'double' } dummy = fillfunc (indj); otherwise @@ -333,7 +334,8 @@ dummy = []; switch (df._type{indc(indi)}) case {'char' } %# use a cell array to hold strings - dummy = RHS(:, indj); + dummy = cellfun (@num2str, RHS(:, indj), \ + 'UniformOutput', false); case {'double' } dummy(idxOK, :) = fillfunc (indj); dummy(~idxOK, :) = NA; otherwise @@ -379,7 +381,8 @@ try switch (df._type{indc(indi)}) case {'char' } %# use a cell array to hold strings - dummy(indr, 1) = RHS(:, indj); + dummy(indr, 1) = cellfun(@num2str, RHS(:, indj), \ + 'UniformOutput', false); case {'double' } dummy(indr, :) = fillfunc (indj); otherwise This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |