Bode function only run once

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Bode function only run once

Nick7
Hello
I am running the following script:
 

pkg load control;
clear global;
s = tf('s');
tf = 1/(1+s*0.318e-8);
bode(tf);


The first run time the Bode plots appears well. When I try to rerun the
script the following error appears:

>> Bode

error: freqresp: second argument 'w' must be a real-valued vector of
frequencies
error: called from
    freqresp at line 52 column 5
    subsref at line 39 column 13
    Bode at line 3 column 3
>>

Any help please?

Regards
 Nick



--
Sent from: https://octave.1599824.n4.nabble.com/Octave-Maintainers-f1638794.html

Reply | Threaded
Open this post in threaded view
|

Re: Bode function only run once

marco atzeri-2
Am 07.02.2020 um 14:27 schrieb Nick7:

> Hello
> I am running the following script:
>  
>
> pkg load control;
> clear global;
> s = tf('s');
> tf = 1/(1+s*0.318e-8);
> bode(tf);
>
>
> The first run time the Bode plots appears well. When I try to rerun the
> script the following error appears:
>
>>> Bode
>
> error: freqresp: second argument 'w' must be a real-valued vector of
> frequencies
> error: called from
>      freqresp at line 52 column 5
>      subsref at line 39 column 13
>      Bode at line 3 column 3
>>>
>
> Any help please?
>
> Regards
>   Nick
>

you are redefinining the meaning of tf on your second assignment.
Try using a different name

octave:18> s = tf('s');
octave:19> tfs = 1/(1+s*0.318e-8);
octave:20> bode(tfs);
octave:21> s = tf('s');
octave:22> tfs = 1/(1+s*0.318e-8);
octave:23> bode(tfs);