changeset 9944:4f74edffa72c octave-forge

control-devel: improve plot for multi-experiment iddata
author paramaniac
date Mon, 02 Apr 2012 11:36:12 +0000
parents 061a3d0c7733
children 5291eef2375e
files extra/control-devel/devel/PowerPlantTest.m extra/control-devel/inst/@iddata/plot.m
diffstat 2 files changed, 16 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/extra/control-devel/devel/PowerPlantTest.m	Mon Apr 02 11:34:53 2012 +0000
+++ b/extra/control-devel/devel/PowerPlantTest.m	Mon Apr 02 11:36:12 2012 +0000
@@ -65,7 +65,7 @@
 % ldwork = [401, 802, 1203, 1604]
 % warning: implicit conversion from real matrix to real scalar
 
-ldwork = [802, 1203, 1604]
+ldwork = [802, 1203, 1604, 3000, 10000]
 
 r = arrayfun (@(x) identtest (dat, 10, 8, x), ldwork, 'uniformoutput', false);
 
--- a/extra/control-devel/inst/@iddata/plot.m	Mon Apr 02 11:34:53 2012 +0000
+++ b/extra/control-devel/inst/@iddata/plot.m	Mon Apr 02 11:36:12 2012 +0000
@@ -26,21 +26,32 @@
 
 function plot (dat)
 
-  [n, p, m, e] = size (dat)
+  [n, p, m, e] = size (dat);
+  expname = __labels__ (dat.expname, "exp");
 
   if (m == 0)  # time series
     for k = 1 : e
+      if (k > 1)
+        pause
+      endif
       plot (dat.y{k})
-      hold on
+      title (expname{k})
+      % hold on
     endfor
   else         # inputs present
     for k = 1 : e
+      if (k > 1)
+        pause
+      endif
       subplot (2, 1, 1)
       plot (dat.y{k})
-      hold on
+      title (expname{k})
+      legend (__labels__ (dat.outname, "y"){:})
+      % hold on
       subplot (2, 1, 2)
       stairs (dat.u{k})
-      hold on
+      legend (__labels__ (dat.inname, "u"){:})
+      % hold on
     endfor
   endif