From: <par...@us...> - 2010-12-05 20:38:10
|
Revision: 7984 http://octave.svn.sourceforge.net/octave/?rev=7984&view=rev Author: paramaniac Date: 2010-12-05 20:38:03 +0000 (Sun, 05 Dec 2010) Log Message: ----------- control: replace nested for-if statement by cellfun for the mere sake of it Modified Paths: -------------- trunk/octave-forge/main/control/inst/__labels__.m Modified: trunk/octave-forge/main/control/inst/__labels__.m =================================================================== --- trunk/octave-forge/main/control/inst/__labels__.m 2010-12-05 16:42:02 UTC (rev 7983) +++ trunk/octave-forge/main/control/inst/__labels__.m 2010-12-05 20:38:03 UTC (rev 7984) @@ -22,7 +22,7 @@ ## Author: Lukas Reichlin <luk...@gm...> ## Created: October 2009 -## Version: 0.2 +## Version: 0.3 function [name, n] = __labels__ (name, variable = "x") @@ -31,11 +31,8 @@ if (n == 0 || isequal ("", name{:})) name = strseq (variable, 1:n); else - for k = 1 : n - if (isempty (name{k})) - name{k} = "?"; - endif - endfor + idx = cellfun (@isempty, name); + name(idx) = "?"; endif endfunction \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |