help-octave
[Top][All Lists]
Advanced

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

Re: 3.4.2 MinGW: bode.m (control-2.1.55) gives error


From: Lukas Reichlin
Subject: Re: 3.4.2 MinGW: bode.m (control-2.1.55) gives error
Date: Mon, 19 Sep 2011 14:23:35 +0200

On 19.09.2011, at 13:39, Bernhard Weller wrote:

> I try to get a simple bode diagram using the code below. This works fine in
> 3.2.4 MinGW (control-1.0.11), but using the latest version I get the
> error-message: "Invalid call to get.  Correct usage is: - Built-in Function: 
> get (H, P)" (see below for complete trace).
> 
> I'm quite far from being able to debug (especially to fix) this myself, it
> seems though, that instead of using the "get" function provided by control
> (in folder @tfpoly) it tries to use the built in get function.
> 
> Any help to fix this is highly appreciated.
> 
> Bernhard
> 
> -------------------------
> %% Circuit constants
> R = 10000;
> C = 22e-9;
> %% Set up transfer function
> H = tf([1], [R*C 1]);
> %  Generate list of frequencies; must use angular frequencies in bode
> command
> F = logspace(1, 5, 1000);
> Omega = 2 * pi * F;
> %  Use bode command to analyze transfer function
> [HMag, HPhase, HOmega] = bode(H, Omega);  % <--- Error happens here
> HMag   = squeeze(HMag);
> HPhase = squeeze(HPhase);
> 
> %% Make plot
> figure(1); clf
> %  Magnitude plot on top
> subplot(2,1,1)
> semilogx(HOmega, 20*log10(HMag), 'k-')
> xlabel('\omega, rad/s')
> ylabel('|H|, dB')
> %  Phase plot on bottom
> subplot(2,1,2)
> semilogx(HOmega, HPhase, 'k-')
> xlabel('\omega, rad/s')
> ylabel('\angle H, rad')
> 
> ----------------------------------------------------
> 
> warning: cellfun: passing function body as a string is obsolete; please use
> anonymous functions
> error: Invalid call to get.  Correct usage is:
> 
> - Built-in Function:  get (H, P)
> 
> error: called from:
> error:  
> C:\Octave\Octave3.4.2_gcc4.5.2\share\octave\3.4.2\m\help\print_usage.m at
> line 87, column 5
> error:   __cellfun_fcn_V__ at line 1, column 37
> error:  
> C:address@hidden
> at line 39, column 9
> error:  
> C:address@hidden
> at line 27, column 21
> error:  
> C:\Octave\Octave3.4.2_gcc4.5.2\share\octave\packages\control-2.1.55\__frequency_response__.m
> at line 50, column 3
> error:  
> C:\Octave\Octave3.4.2_gcc4.5.2\share\octave\packages\control-2.1.55\bode.m
> at line 58, column 11
> 
> 
> 
> 
> --
> View this message in context: 
> http://octave.1599824.n4.nabble.com/3-4-2-MinGW-bode-m-control-2-1-55-gives-error-tp3823682p3823682.html
> Sent from the Octave - General mailing list archive at Nabble.com.
> _______________________________________________
> Help-octave mailing list
> address@hidden
> https://mailman.cae.wisc.edu/listinfo/help-octave


Hi Bernhard

On my Mac running Octave 3.4.2 I can't reproduce your error. The attached 
m-file runs without a single warning or error and produces the plot. It would 
be good if some other people - especially on Windows - could try out the script 
and see if it works for them.

Would it help if you change lines 39 and 40 in @lti/tfdata.m from

    num = cellfun ("@tfpoly/get", num, "uniformoutput", false);
    den = cellfun ("@tfpoly/get", den, "uniformoutput", false);

to

    num = cellfun (@get, num, "uniformoutput", false);
    den = cellfun (@get, den, "uniformoutput", false);

? Maybe you need to restart Octave after you made these changes.

Regards,
Lukas


Attachment: bernhardweller.m
Description: Binary data


reply via email to

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