help-octave
[Top][All Lists]
Advanced

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

Substitute regular operators by element by element operator?


From: Javier Arantegui
Subject: Substitute regular operators by element by element operator?
Date: Wed, 28 Jan 2009 14:50:10 +0100

Hi!

Yesterday I wrote an small .m file to plot Bode diagrams. It's the
file mybode.m, attached to this mail. Nothing complicated. Although
showing the grid has been a challenge, I was beginning to think that I
was too stupid to understand how "grid" worked until I found this (*)
today. I'm using Octave 3.0.1. That bug drove me crazy yesterday.

(*) "grid() not working in 3.0.0"
http://groups.google.com/group/comp.soft-sys.octave/browse_thread/thread/de4086d739e89748/cc544928bee0316c


The use of mybode is very simple. For example,

mybode("1./(s.^2.+.25.*s.+1)",0.2,0.1,10);

draws the bode diagram of the transfer function
1/(s^2+0.25*s+1)*exp(-0.2) between Omega=0.1 and Omega=10. I
programmed it because I didn't want to use dB and to include the
effect of a delay.

Obviously to make this script work the function has to be introduced
using the element by element operators. Is there an easy way to
transform 1/(s^2+0.25*s+1) to 1./(s.^2.+.25.*s.+1)? My objective would
be that I could type the function using regular operators directly,
like this:

mybode("1/(s^2+25*s+1)",0.2,0.1,10);

If it is not easy, it's not a problem at all.

Thanks in advance,

Javier

Attachment: mybode.m
Description: Binary data


reply via email to

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