[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
'hold on' command does not work with OCST
From: |
John W. Eaton |
Subject: |
'hold on' command does not work with OCST |
Date: |
Wed, 18 Feb 2004 22:47:09 -0600 |
On 19-Feb-2004,
=?tis-620?Q?=BC=C8.=B4=C3.=C8=D8=C0=AA=D1=C2_=C7=C3=BE=A8=B9=EC=BE=D4?=
=?tis-620?Q?=C8=D8=B7=B8=D4=EC?= <address@hidden> wrote:
| I try to use command 'hold on' with the following commands in OCST to make
| a comparison graph. But it does not work.
|
| >> G1 = tf2sys([1],[1 1]);
| >> G2 = tf2sys([1],[1 5]);
| >> hold on
| >> step(G1);
| >> step(G2);
|
| However if I change to 'bode' command, it can print the graph with two
| traces but the magnitude graph for the second bode command does not show.
| I think that this may be the problem from the calling sequence with OCST
| simulation commands.
It looks like __stepimp__.m calls clearplot before doing any plotting,
even when it will only be plotting for a SISO system. Maybe it should
only do that if there is more than one input or output. I propose the
following change. It looks OK to me, but I'm not sure whether it will
break something else.
jwe
scripts/ChangeLog:
2004-02-18 John W. Eaton <address@hidden>
* control/base/__stepimp__.m: Only call clearplot if we will be
doing multiple plots in the same gnuplot frame.
Index: scripts/control/base/__stepimp__.m
===================================================================
RCS file: /usr/local/cvsroot/octave/scripts/control/base/__stepimp__.m,v
retrieving revision 1.7
diff -u -r1.7 __stepimp__.m
--- scripts/control/base/__stepimp__.m 16 Feb 2004 17:45:50 -0000 1.7
+++ scripts/control/base/__stepimp__.m 19 Feb 2004 04:44:21 -0000
@@ -223,7 +223,6 @@
gset nologscale
gset autoscale
gset nokey
- clearplot();
if (IMPULSE)
gm = zeros(NOUT, 1);
tt = "impulse";
@@ -234,6 +233,9 @@
endif
ncols = floor(sqrt(NOUT));
nrows = ceil(NOUT / ncols);
+ if (ncols > 1 || nrows > 1)
+ clearplot();
+ endif
for i = 1:NOUT
subplot(nrows, ncols, i);
title(sprintf("%s: | %s -> %s", tt,sysgetsignals(sys,"in",inp,1), ...
-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.
Octave's home on the web: http://www.octave.org
How to fund new projects: http://www.octave.org/funding.html
Subscription information: http://www.octave.org/archive.html
-------------------------------------------------------------