From: <par...@us...> - 2012-09-14 18:38:07
|
Revision: 11019 http://octave.svn.sourceforge.net/octave/?rev=11019&view=rev Author: paramaniac Date: 2012-09-14 18:38:01 +0000 (Fri, 14 Sep 2012) Log Message: ----------- control: fix margin Modified Paths: -------------- trunk/octave-forge/main/control/inst/__frequency_response__.m trunk/octave-forge/main/control/inst/margin.m Modified: trunk/octave-forge/main/control/inst/__frequency_response__.m =================================================================== --- trunk/octave-forge/main/control/inst/__frequency_response__.m 2012-09-14 18:20:47 UTC (rev 11018) +++ trunk/octave-forge/main/control/inst/__frequency_response__.m 2012-09-14 18:38:01 UTC (rev 11019) @@ -25,10 +25,12 @@ function [H, w] = __frequency_response__ (args, mimoflag = 0, resptype = 0, wbounds = "std", cellflag = false) - %if (! iscell (args)) - % args = {args}; - %endif + isc = iscell (args); + if (! isc) + args = {args}; + endif + sys_idx = cellfun (@isa, args, {"lti"}); # look for LTI models w_idx = cellfun (@(x) is_real_vector (x) && length (x) > 1, args); # look for frequency vectors r_idx = cellfun (@iscell, args); # look for frequency ranges {wmin, wmax} @@ -65,4 +67,9 @@ ## restore frequency vectors of FRD models in w w(frd_idx) = w_frd; + if (! isc) # for old non-multiplot functions + H = H{1}; + w = w{1}; + endif + endfunction Modified: trunk/octave-forge/main/control/inst/margin.m =================================================================== --- trunk/octave-forge/main/control/inst/margin.m 2012-09-14 18:20:47 UTC (rev 11018) +++ trunk/octave-forge/main/control/inst/margin.m 2012-09-14 18:38:01 UTC (rev 11019) @@ -269,7 +269,7 @@ if (nargout == 0) # show bode diagram - [H, w] = __frequency_response__ (sys, [], false, 0, "std"); + [H, w] = __frequency_response__ (sys, false, 0, "std"); H = reshape (H, [], 1); mag_db = 20 * log10 (abs (H)); @@ -301,14 +301,14 @@ endif subplot (2, 1, 1) - semilogx (w, mag_db, "b", wv, [0, 0], ":k", wgm, mgmh, ":k", wgm, mgm, "r", wpm, mpm, ":k") + semilogx (w, mag_db, "b", wv, [0, 0], "-.k", wgm, mgmh, "-.k", wgm, mgm, "r", wpm, mpm, "-.k") axis (ax_vec_mag) grid ("on") title (title_str) ylabel ("Magnitude [dB]") subplot (2, 1, 2) - semilogx (w, pha, "b", wv, [-180, -180], ":k", wgm, pgm, ":k", wpm, ppmh, ":k", wpm, ppm, "r") + semilogx (w, pha, "b", wv, [-180, -180], "-.k", wgm, pgm, "-.k", wpm, ppmh, "-.k", wpm, ppm, "r") axis (ax_vec_pha) grid ("on") xlabel (xl_str) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |