help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: bode diagram


From: Dmitri A. Sergatskov
Subject: Re: bode diagram
Date: Sun, 18 Apr 2004 00:14:52 -0600
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040115

address@hidden via John W. Eaton wrote:
hello,

I have a problem about saving my bode diagram.

sys=tf2sys([2 1],[1 2 1]);
bode(sys)
gset term png
gset output 'bode.png'
replot

I should have got two pictures-- but all I have got was the phase
diagram only. What should I do?

This is just yet another problem due to gnuplot shortcomings.
To make two pictures bode() switches to multiplot and back to
oneplot. So when you do replot, you only replotting last plot
of the multiplot. Unfortunately, if you stay in multiplot you
cannot switch terminal type nor output file. So you have to set
terminal and output first. But here you would get bitten by small
"bug" in bode() code. Before any plotting it does "clearplot()"
that makes an empty page for postscript terminal and complitely
messes up png terminal (and probably some others) which does not
know how to handle multiple pages at all.

So to make this long and sad story short, you can do the
following:

Find and copy bode.m into your working directory. Rename it into
mybode() (change the function name inside as well).
Find clearplot() call inside this file and comment it out.
Change your code as follows:

sys=tf2sys([2 1],[1 2 1]);
mybode(sys)     # this is optional -- but I assume you still want to see
                # picture on your screen
gset term png
gset output 'bode.png'
mybode(sys)



Regards,

kevwalker.


Hope it helps,

Dmitri.



-------------------------------------------------------------
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
-------------------------------------------------------------



reply via email to

[Prev in Thread] Current Thread [Next in Thread]