From: <par...@us...> - 2012-03-07 18:53:59
|
Revision: 9770 http://octave.svn.sourceforge.net/octave/?rev=9770&view=rev Author: paramaniac Date: 2012-03-07 17:51:32 +0000 (Wed, 07 Mar 2012) Log Message: ----------- control-devel: replace [] by {} to simplify code in cat :-) Modified Paths: -------------- trunk/octave-forge/extra/control-devel/inst/@iddata/cat.m trunk/octave-forge/extra/control-devel/inst/@iddata/iddata.m trunk/octave-forge/extra/control-devel/inst/__adjust_iddata__.m Modified: trunk/octave-forge/extra/control-devel/inst/@iddata/cat.m =================================================================== --- trunk/octave-forge/extra/control-devel/inst/@iddata/cat.m 2012-03-07 17:40:03 UTC (rev 9769) +++ trunk/octave-forge/extra/control-devel/inst/@iddata/cat.m 2012-03-07 17:51:32 UTC (rev 9770) @@ -36,25 +36,15 @@ check_inputs (tmp, m); y = cellfun (@vertcat, tmp.y, "uniformoutput", false); - - if (m{1} > 0) # m(2:end) are equal, tested by check_inputs - u = cellfun (@vertcat, tmp.u, "uniformoutput", false); - else # time series don't have inputs - u = []; - endif + u = cellfun (@vertcat, tmp.u, "uniformoutput", false); case 2 # horzcat - catenate channels check_experiments (tmp, e); check_samples (n); y = cellfun (@horzcat, tmp.y, "uniformoutput", false); - - if (m{1} > 0) - u = cellfun (@horzcat, tmp.u, "uniformoutput", false); - else - u = []; - endif - + u = cellfun (@horzcat, tmp.u, "uniformoutput", false); + case 3 # merge - catenate experiments check_outputs (tmp, p); check_inputs (tmp, m); Modified: trunk/octave-forge/extra/control-devel/inst/@iddata/iddata.m =================================================================== --- trunk/octave-forge/extra/control-devel/inst/@iddata/iddata.m 2012-03-07 17:40:03 UTC (rev 9769) +++ trunk/octave-forge/extra/control-devel/inst/@iddata/iddata.m 2012-03-07 17:51:32 UTC (rev 9770) @@ -56,7 +56,7 @@ ## Created: October 2011 ## Version: 0.1 -function dat = iddata (y = [], u = [], tsam = [], varargin) +function dat = iddata (y = {}, u = {}, tsam = {}, varargin) if (nargin == 1 && isa (y, "iddata")) dat = y; Modified: trunk/octave-forge/extra/control-devel/inst/__adjust_iddata__.m =================================================================== --- trunk/octave-forge/extra/control-devel/inst/__adjust_iddata__.m 2012-03-07 17:40:03 UTC (rev 9769) +++ trunk/octave-forge/extra/control-devel/inst/__adjust_iddata__.m 2012-03-07 17:51:32 UTC (rev 9770) @@ -28,7 +28,7 @@ endif if (isempty (u)) - u = []; # avoid [](nx0) and the like + u = {}; # avoid [](nx0) and the like elseif (iscell (u)) u = reshape (u, [], 1); else This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |