Mercurial > forge
changeset 9584:f0001b666a66 octave-forge
control-devel: replace [] by {} to simplify code in cat :-)
author | paramaniac |
---|---|
date | Wed, 07 Mar 2012 17:51:32 +0000 |
parents | e29c0c3766b8 |
children | c45b230d1c69 |
files | extra/control-devel/inst/@iddata/cat.m extra/control-devel/inst/@iddata/iddata.m extra/control-devel/inst/__adjust_iddata__.m |
diffstat | 3 files changed, 5 insertions(+), 15 deletions(-) [+] |
line wrap: on
line diff
--- a/extra/control-devel/inst/@iddata/cat.m Wed Mar 07 17:40:03 2012 +0000 +++ b/extra/control-devel/inst/@iddata/cat.m Wed Mar 07 17:51:32 2012 +0000 @@ -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);
--- a/extra/control-devel/inst/@iddata/iddata.m Wed Mar 07 17:40:03 2012 +0000 +++ b/extra/control-devel/inst/@iddata/iddata.m Wed Mar 07 17:51:32 2012 +0000 @@ -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;
--- a/extra/control-devel/inst/__adjust_iddata__.m Wed Mar 07 17:40:03 2012 +0000 +++ b/extra/control-devel/inst/__adjust_iddata__.m Wed Mar 07 17:51:32 2012 +0000 @@ -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