changeset 8876:bf3b371d5a9e octave-forge

control-devel: add test to fitfrd, fix docstring
author paramaniac
date Fri, 11 Nov 2011 10:50:51 +0000
parents 903fbabbd5fe
children 6336c4ca5702
files extra/control-devel/inst/fitfrd.m
diffstat 1 files changed, 14 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/extra/control-devel/inst/fitfrd.m	Fri Nov 11 07:47:37 2011 +0000
+++ b/extra/control-devel/inst/fitfrd.m	Fri Nov 11 10:50:51 2011 +0000
@@ -36,7 +36,7 @@
 ## @strong{Outputs}
 ## @table @var
 ## @item sys
-## State-space model of the H-infinity loop-shaping controller.
+## State-space model of order @var{n}, fitted to frequency response data @var{dat}.
 ## @item n
 ## The order of the obtained system.  The value of @var{n}
 ## could only be modified if inputs @code{n > 0} and @code{flag = 1}.
@@ -80,4 +80,16 @@
   
   sys = ss (a, b, c, d, tsam);
 
-endfunction
\ No newline at end of file
+endfunction
+
+
+%!shared Yo, Ye
+%! SYS = ss (-1, 1, 1, 0);
+%! T = 0:0.1:50;
+%! Ye = step (SYS, T);
+%! W = logspace (-2, 2, 100);
+%! FR = frd (SYS, W);
+%! N = 1;
+%! SYSID = fitfrd (FR, N, 1);
+%! Yo = step (SYSID, T);
+%!assert (Yo, Ye, 1e-2);
\ No newline at end of file