changeset 6818:9483da8d87e5

[project @ 2007-08-22 08:49:18 by dbateman]
author dbateman
date Wed, 22 Aug 2007 08:49:19 +0000
parents 2e7f62e52c13
children 3350e816e2a4
files scripts/ChangeLog scripts/control/base/nichols.m
diffstat 2 files changed, 19 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/ChangeLog	Sun Aug 19 19:36:40 2007 +0000
+++ b/scripts/ChangeLog	Wed Aug 22 08:49:19 2007 +0000
@@ -1,3 +1,12 @@
+2007-08-22  David Bateman  <dbateman@free.fr>
+
+	* control/base/nichols.m: Correct for misnamed variable, and ensure
+	outputs are returned only if requested.
+
+2007-08-22  Donald Parsons  <dparsons@brightdsl.net>
+
+	* control/base/nichols.m: Fix typo.
+
 2007-08-13  John W. Eaton  <jwe@octave.org>
 
 	* plot/meshgrid.m: Use repmat instead of multiplication.
--- a/scripts/control/base/nichols.m	Sun Aug 19 19:36:40 2007 +0000
+++ b/scripts/control/base/nichols.m	Wed Aug 22 08:49:19 2007 +0000
@@ -82,7 +82,7 @@
 ## and phase information is not computed.
 ## @end deftypefn
 
-function [mag, phase, w] = nichols (sys, w, outputs, inputs)
+function [mag2, phase2, w2] = nichols (sys, w, outputs, inputs)
 
   ## check number of input arguments given
   if (nargin < 1 || nargin > 4)
@@ -111,10 +111,12 @@
     ## Plot the information
 
     if (max (mag) > 0)
-      plot (phase, 20 * log10 (mag));
+      md = 20 * log10 (mag);
+      plot (phase, md);
       ylabel ("Gain in dB");
     else
-      plot (phase, mag);
+      md = mag;
+      plot (phase, md);
       ylabel ("Gain |Y/U|")
     endif
 
@@ -131,7 +133,7 @@
     if (is_siso (sys))
       title (sprintf ("Nichols plot of |[Y/U]%s|, u=%s, y=%s", tistr,
 		      sysgetsignals (sys, "in", 1, 1),
-		      sysgetsignals (sys, "out", 1, 1));
+		      sysgetsignals (sys, "out", 1, 1)));
     else
       title ([ "||Y(", tistr, ")/U(", tistr, ")||"]);
       printf ("MIMO plot from\n%s\nto\n%s\n", __outlist__ (inname, "    "),
@@ -139,8 +141,10 @@
     endif
 
     axis (axis2dlim ([phase(:), md(:)]));
-
-    mag = phase = w = [];
+  else
+    mag2 = mag;
+    phase2 = phase;
+    w2 = w;
   endif
 
 endfunction