changeset 10190:7ad7db58b8b1 octave-forge

control: list tf property 'inv', require discrete-time systems
author paramaniac
date Tue, 08 May 2012 07:56:26 +0000
parents bf68bc231f54
children bd0ba1979a13
files main/control/inst/@tf/__property_names__.m main/control/inst/@tf/__set__.m
diffstat 2 files changed, 9 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/main/control/inst/@tf/__property_names__.m	Mon May 07 13:38:26 2012 +0000
+++ b/main/control/inst/@tf/__property_names__.m	Tue May 08 07:56:26 2012 +0000
@@ -30,12 +30,14 @@
   ## cell vector of tf-specific properties
   props = {"num";
            "den";
-           "tfvar"};
+           "tfvar";
+           "inv"};
 
   ## cell vector of tf-specific assignable values
   vals = {"p-by-m cell array of row vectors (m = number of inputs)";
           "p-by-m cell array of row vectors (p = number of outputs)";
-          "string (usually s or z)"};
+          "string (usually s or z)";
+          "logical (true for negative powers of TF variable)"};
 
   if (nargin == 1)
     [ltiprops, ltivals] = __property_names__ (sys.lti);
--- a/main/control/inst/@tf/__set__.m	Mon May 07 13:38:26 2012 +0000
+++ b/main/control/inst/@tf/__set__.m	Tue May 08 07:56:26 2012 +0000
@@ -43,10 +43,12 @@
       endif
 
     case "inv"
-      if (isscalar (val))
+      if (! isdt (sys))
+        error ("tf: set: property 'inv' requires discrete-time system");
+      elseif (! isscalar (val))
+        error ("tf: set: property 'inv' must be a scalar logical");
+      else
         sys.inv = logical (val);
-      else
-        error ("tf: set: property 'inv' must be a scalar logical");
       endif
 
     otherwise