From: <par...@us...> - 2012-06-29 07:33:07
|
Revision: 10703 http://octave.svn.sourceforge.net/octave/?rev=10703&view=rev Author: paramaniac Date: 2012-06-29 07:33:00 +0000 (Fri, 29 Jun 2012) Log Message: ----------- control-devel: support frequency domain datasets Modified Paths: -------------- trunk/octave-forge/extra/control-devel/inst/@iddata/iddata.m trunk/octave-forge/extra/control-devel/inst/@iddata/ifft.m trunk/octave-forge/extra/control-devel/inst/@iddata/set.m trunk/octave-forge/extra/control-devel/inst/__iddata_dim__.m Modified: trunk/octave-forge/extra/control-devel/inst/@iddata/iddata.m =================================================================== --- trunk/octave-forge/extra/control-devel/inst/@iddata/iddata.m 2012-06-29 06:08:32 UTC (rev 10702) +++ trunk/octave-forge/extra/control-devel/inst/@iddata/iddata.m 2012-06-29 07:33:00 UTC (rev 10703) @@ -141,6 +141,10 @@ dat = set (dat, varargin{:}); endif + if (dat.timedomain && ! is_real_matrix (dat.y{:}, dat.u{:})) + error ("iddata: require real-valued input and output signals for time domain datasets"); + endif + endfunction Modified: trunk/octave-forge/extra/control-devel/inst/@iddata/ifft.m =================================================================== --- trunk/octave-forge/extra/control-devel/inst/@iddata/ifft.m 2012-06-29 06:08:32 UTC (rev 10702) +++ trunk/octave-forge/extra/control-devel/inst/@iddata/ifft.m 2012-06-29 07:33:00 UTC (rev 10703) @@ -67,6 +67,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 = {}; ## 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 06:08:32 UTC (rev 10702) +++ trunk/octave-forge/extra/control-devel/inst/@iddata/set.m 2012-06-29 07:33:00 UTC (rev 10703) @@ -94,6 +94,14 @@ dat.expname = __adjust_labels__ (val, e); 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))) + error ("iddata: set: w must be a vector of positive real values in ascending order"); + endif + dat.w = val; + dat.timedomain = false; case "name" if (ischar (val)) sys.name = val; Modified: trunk/octave-forge/extra/control-devel/inst/__iddata_dim__.m =================================================================== --- trunk/octave-forge/extra/control-devel/inst/__iddata_dim__.m 2012-06-29 06:08:32 UTC (rev 10702) +++ trunk/octave-forge/extra/control-devel/inst/__iddata_dim__.m 2012-06-29 07:33:00 UTC (rev 10703) @@ -30,8 +30,8 @@ function [p, m] = __experiment_dim__ (y, u = []) - if (! is_real_matrix (y, u)) - error ("iddata: inputs and outputs must be real"); + if (! is_matrix (y, u)) + error ("iddata: inputs and outputs must be real or complex matrices"); endif [ly, p] = size (y); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |