From: <par...@us...> - 2012-09-14 11:55:49
|
Revision: 11013 http://octave.svn.sourceforge.net/octave/?rev=11013&view=rev Author: paramaniac Date: 2012-09-14 11:55:40 +0000 (Fri, 14 Sep 2012) Log Message: ----------- control: fix bug, use new multiplot bode in example Madievski.m Modified Paths: -------------- trunk/octave-forge/main/control/inst/Madievski.m trunk/octave-forge/main/control/inst/__frequency_response__.m Modified: trunk/octave-forge/main/control/inst/Madievski.m =================================================================== --- trunk/octave-forge/main/control/inst/Madievski.m 2012-09-14 11:44:35 UTC (rev 11012) +++ trunk/octave-forge/main/control/inst/Madievski.m 2012-09-14 11:55:40 UTC (rev 11013) @@ -86,30 +86,7 @@ w = {1e-2, 1e1}; % Bode Plot of Controller -[mag, pha, w] = bode (K, w); -[magr4, phar4, wr4] = bode (Kr4, w); -[magr2, phar2, wr2] = bode (Kr2, w); - -mag = 20 * log10 (mag); -magr4 = 20 * log10 (magr4); -magr2 = 20 * log10 (magr2); - -figure (1) -subplot (2, 1, 1) -semilogx (w, mag, wr4, magr4, wr2, magr2) -axis ('tight') -ylim (__axis_margin__ (ylim)) -grid ('on') -title ('Bode Diagrams of K and Kr') -ylabel ('Magnitude [dB]') - -subplot (2, 1, 2) -semilogx (w, pha, wr4, phar4, wr2, phar2) -axis ('tight') -ylim (__axis_margin__ (ylim)) -grid ('on') -xlabel ('Frequency [rad/s]') -ylabel ('Phase [deg]') +bode (K, Kr4, Kr2, w) legend ('K (8 states)', 'Kr (4 states)', 'Kr (2 states)', 'location', 'southwest') % Step Response of Closed Loop Modified: trunk/octave-forge/main/control/inst/__frequency_response__.m =================================================================== --- trunk/octave-forge/main/control/inst/__frequency_response__.m 2012-09-14 11:44:35 UTC (rev 11012) +++ trunk/octave-forge/main/control/inst/__frequency_response__.m 2012-09-14 11:55:40 UTC (rev 11013) @@ -50,7 +50,7 @@ error ("frequency_response: invalid cell"); endif elseif (any (w_idx)) # are there any frequency vectors? - w = args(w_idx){end}; + w = args(w_idx)(end); else # there are neither frequency ranges nor vectors w = __frequency_vector__ (sys_cell, wbounds); endif This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |