From: <par...@us...> - 2012-03-04 17:35:48
|
Revision: 9743 http://octave.svn.sourceforge.net/octave/?rev=9743&view=rev Author: paramaniac Date: 2012-03-04 17:35:42 +0000 (Sun, 04 Mar 2012) Log Message: ----------- control-devel: more draft code for iddata cat method Modified Paths: -------------- trunk/octave-forge/extra/control-devel/devel/test_iddata.m trunk/octave-forge/extra/control-devel/inst/@iddata/cat.m Modified: trunk/octave-forge/extra/control-devel/devel/test_iddata.m =================================================================== --- trunk/octave-forge/extra/control-devel/devel/test_iddata.m 2012-03-04 15:58:30 UTC (rev 9742) +++ trunk/octave-forge/extra/control-devel/devel/test_iddata.m 2012-03-04 17:35:42 UTC (rev 9743) @@ -29,4 +29,12 @@ f.expname{2} = "value 2" %} -cat (4, f, f, f) \ No newline at end of file +%cat (4, f, f, f) + +%cat (1, f, f) + +u = iddata ({(1:10).', (21:30).'}, {(41:50).', (61:70).'}); +v = iddata ({(11:20).', (31:40).'}, {(51:60).', (71:80).'}); + + +w = cat (1, u, v) \ No newline at end of file Modified: trunk/octave-forge/extra/control-devel/inst/@iddata/cat.m =================================================================== --- trunk/octave-forge/extra/control-devel/inst/@iddata/cat.m 2012-03-04 15:58:30 UTC (rev 9742) +++ trunk/octave-forge/extra/control-devel/inst/@iddata/cat.m 2012-03-04 17:35:42 UTC (rev 9743) @@ -30,16 +30,20 @@ case 1 # add samples; p, m, e identical %[~, p, m, e] %nvec = cellfun (@size - [~, p, m, e] = cellfun (@size, varargin, "uniformoutput", false) + %[~, p, m, e] = cellfun (@size, varargin, "uniformoutput", false) %y = cellfun (@(dat) vertcat (dat.y) %dat = cellfun (@iddata, varargin) #y = cellfun (@vertcat - ycell = cellfun (@(dat) dat.y, varargin, "uniformoutput", false) + #ycell = cellfun (@(dat) dat.y, varargin, "uniformoutput", false) + tmp = cellfun (@iddata, varargin); + y = cellfun (@vertcat, tmp.y, "uniformoutput", false); + u = cellfun (@vertcat, tmp.u, "uniformoutput", false); + + dat = iddata (y, u); - %varargin{:}.y %varargin(:).y case 2 # horzcat, same outputs; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |