From: <par...@us...> - 2012-09-18 06:25:36
|
Revision: 11046 http://octave.svn.sourceforge.net/octave/?rev=11046&view=rev Author: paramaniac Date: 2012-09-18 06:25:30 +0000 (Tue, 18 Sep 2012) Log Message: ----------- control: quicksave time response draft code Modified Paths: -------------- trunk/octave-forge/main/control/devel/__time_response_2__.m Modified: trunk/octave-forge/main/control/devel/__time_response_2__.m =================================================================== --- trunk/octave-forge/main/control/devel/__time_response_2__.m 2012-09-18 05:58:35 UTC (rev 11045) +++ trunk/octave-forge/main/control/devel/__time_response_2__.m 2012-09-18 06:25:30 UTC (rev 11046) @@ -128,12 +128,15 @@ case "initial" str = "Response to Initial Conditions"; cols = 1; + yfinal = zeros (p, 1); case "step" str = "Step Response"; cols = m; + yfinal = dcgain (sys_cell{1}); case "impulse" str = "Impulse Response"; cols = m; + yfinal = zeros (p, m); otherwise error ("time_response: invalid response type"); endswitch @@ -170,7 +173,12 @@ for i = 1 : p # for every output for j = 1 : cols # for every input (except for initial where cols=1) subplot (p, cols, (i-1)*cols+j); - plot (t{k}, y{k}(:, i, j), style{:}); + if (n_sys == 1 && isstable (sys_cell{1})) + plot (t{k}, y{k}(:, i, j), style{:}, [t{k}(1), t{k}(end)], repmat (yfinal(i,j), 1, 2)); + ## TODO: plot final value first such that its line doesn't overprint the response + else + plot (t{k}, y{k}(:, i, j), style{:}); + endif hold on; grid on; if (k == n_sys) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |