[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Substitute regular operators by element by element operator?
From: |
Jaroslav Hajek |
Subject: |
Re: Substitute regular operators by element by element operator? |
Date: |
Wed, 28 Jan 2009 15:05:21 +0100 |
On Wed, Jan 28, 2009 at 2:50 PM, Javier Arantegui
<address@hidden> wrote:
> 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
>
> _______________________________________________
> Help-octave mailing list
> address@hidden
> https://www-old.cae.wisc.edu/mailman/listinfo/help-octave
>
>
See the "vectorize" function.
cheers
--
RNDr. Jaroslav Hajek
computing expert
Aeronautical Research and Test Institute (VZLU)
Prague, Czech Republic
url: www.highegg.matfyz.cz