From: <par...@us...> - 2012-06-29 09:03:19
|
Revision: 10705 http://octave.svn.sourceforge.net/octave/?rev=10705&view=rev Author: paramaniac Date: 2012-06-29 09:03:08 +0000 (Fri, 29 Jun 2012) Log Message: ----------- control-devel: support frequency domain datasets (3) Modified Paths: -------------- trunk/octave-forge/extra/control-devel/inst/@iddata/ifft.m trunk/octave-forge/extra/control-devel/inst/@iddata/set.m Modified: trunk/octave-forge/extra/control-devel/inst/@iddata/ifft.m =================================================================== --- trunk/octave-forge/extra/control-devel/inst/@iddata/ifft.m 2012-06-29 08:14:29 UTC (rev 10704) +++ trunk/octave-forge/extra/control-devel/inst/@iddata/ifft.m 2012-06-29 09:03:08 UTC (rev 10705) @@ -75,7 +75,7 @@ ## ifft (x, n, dim=1) because x could be a row vector (n=1) % dat.w = cellfun (@(n, tsam) (0:fix(n/2)).' * (2*pi/abs(tsam)/n), n, dat.tsam, "uniformoutput", false); - dat.w = {}; + dat.w = {}; % dat.w = repmat ({[]}, e, 1); ??? ## abs(tsam) because of -1 for undefined sampling times dat.timedomain = true; Modified: trunk/octave-forge/extra/control-devel/inst/@iddata/set.m =================================================================== --- trunk/octave-forge/extra/control-devel/inst/@iddata/set.m 2012-06-29 08:14:29 UTC (rev 10704) +++ trunk/octave-forge/extra/control-devel/inst/@iddata/set.m 2012-06-29 09:03:08 UTC (rev 10705) @@ -95,9 +95,13 @@ case {"tsam", "ts"} dat.tsam = __adjust_iddata_tsam__ (val, e); case {"w", "frequency"} - if (! isempty (val) && (! is_real_vector (val) || any (val < 0) \ - || ! issorted (val) || val(1) > val(end) \ - || length (unique (val)) != length (val))) + if (! iscell (val)) + val = {val}; + endif + + if (any (cellfun (@(w) ! isempty (w) && (! is_real_vector (w) || any (w < 0) \ + || ! issorted (w) || w(1) > w(end) \ + || length (unique (w)) != length (w)), val))) error ("iddata: set: w must be a vector of positive real values in ascending order"); endif dat.w = val; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |