From: <par...@us...> - 2010-11-22 20:12:57
|
Revision: 7939 http://octave.svn.sourceforge.net/octave/?rev=7939&view=rev Author: paramaniac Date: 2010-11-22 20:12:51 +0000 (Mon, 22 Nov 2010) Log Message: ----------- control: display system name in various plot commands Modified Paths: -------------- trunk/octave-forge/main/control/inst/__time_response__.m trunk/octave-forge/main/control/inst/bode.m trunk/octave-forge/main/control/inst/bodemag.m trunk/octave-forge/main/control/inst/impulse.m trunk/octave-forge/main/control/inst/initial.m trunk/octave-forge/main/control/inst/lsim.m trunk/octave-forge/main/control/inst/nichols.m trunk/octave-forge/main/control/inst/nyquist.m trunk/octave-forge/main/control/inst/pzmap.m trunk/octave-forge/main/control/inst/rlocus.m trunk/octave-forge/main/control/inst/sigma.m trunk/octave-forge/main/control/inst/step.m Modified: trunk/octave-forge/main/control/inst/__time_response__.m =================================================================== --- trunk/octave-forge/main/control/inst/__time_response__.m 2010-11-22 17:11:24 UTC (rev 7938) +++ trunk/octave-forge/main/control/inst/__time_response__.m 2010-11-22 20:12:51 UTC (rev 7939) @@ -22,7 +22,7 @@ ## Created: October 2009 ## Version: 0.2 -function [y, t, x_arr] = __time_response__ (sys, resptype, plotflag, tfinal, dt, x0) +function [y, t, x_arr] = __time_response__ (sys, resptype, plotflag, tfinal, dt, x0, sysname) if (! isa (sys, "ss")) sys = ss (sys); # sys must be proper @@ -64,7 +64,7 @@ switch (resptype) case "initial" - str = "Response to Initial Conditions"; + str = ["Response of ", sysname, " to Initial Conditions"]; yfinal = zeros (p, 1); ## preallocate memory @@ -86,7 +86,7 @@ endfor case "step" - str = "Step Response"; + str = ["Step Response of ", sysname]; yfinal = dcgain (sys); ## preallocate memory @@ -108,7 +108,7 @@ endfor case "impulse" - str = "Impulse Response"; + str = ["Impulse Response of ", sysname]; yfinal = zeros (p, m); ## preallocate memory Modified: trunk/octave-forge/main/control/inst/bode.m =================================================================== --- trunk/octave-forge/main/control/inst/bode.m 2010-11-22 17:11:24 UTC (rev 7938) +++ trunk/octave-forge/main/control/inst/bode.m 2010-11-22 20:12:51 UTC (rev 7939) @@ -80,7 +80,7 @@ semilogx (w, mag_db) axis (ax_vec_mag) grid ("on") - title ("Bode Diagram") + title (["Bode Diagram of ", inputname(1)]) ylabel ("Magnitude [dB]") subplot (2, 1, 2) Modified: trunk/octave-forge/main/control/inst/bodemag.m =================================================================== --- trunk/octave-forge/main/control/inst/bodemag.m 2010-11-22 17:11:24 UTC (rev 7938) +++ trunk/octave-forge/main/control/inst/bodemag.m 2010-11-22 20:12:51 UTC (rev 7939) @@ -74,7 +74,7 @@ semilogx (w, mag_db) axis (ax_vec_mag) grid ("on") - title ("Bode Magnitude Diagram") + title (["Bode Magnitude Diagram of ", inputname(1)]) xlabel (xl_str) ylabel ("Magnitude [dB]") else Modified: trunk/octave-forge/main/control/inst/impulse.m =================================================================== --- trunk/octave-forge/main/control/inst/impulse.m 2010-11-22 17:11:24 UTC (rev 7938) +++ trunk/octave-forge/main/control/inst/impulse.m 2010-11-22 20:12:51 UTC (rev 7939) @@ -64,7 +64,7 @@ print_usage (); endif - [y, t, x] = __time_response__ (sys, "impulse", ! nargout, tfinal, dt); + [y, t, x] = __time_response__ (sys, "impulse", ! nargout, tfinal, dt, [], inputname(1)); if (nargout) y_r = y; Modified: trunk/octave-forge/main/control/inst/initial.m =================================================================== --- trunk/octave-forge/main/control/inst/initial.m 2010-11-22 17:11:24 UTC (rev 7938) +++ trunk/octave-forge/main/control/inst/initial.m 2010-11-22 20:12:51 UTC (rev 7939) @@ -76,7 +76,7 @@ print_usage (); endif - [y, t, x] = __time_response__ (sys, "initial", ! nargout, tfinal, dt, x0); + [y, t, x] = __time_response__ (sys, "initial", ! nargout, tfinal, dt, x0, inputname(1)); if (nargout) y_r = y; Modified: trunk/octave-forge/main/control/inst/lsim.m =================================================================== --- trunk/octave-forge/main/control/inst/lsim.m 2010-11-22 17:11:24 UTC (rev 7938) +++ trunk/octave-forge/main/control/inst/lsim.m 2010-11-22 20:12:51 UTC (rev 7939) @@ -136,7 +136,7 @@ endfor if (! nargout) # plot information - str = "Linear Simulation Results"; + str = ["Linear Simulation Results of ", inputname(1)]; outname = get (sys, "outname"); outname = __labels__ (outname, "y_"); Modified: trunk/octave-forge/main/control/inst/nichols.m =================================================================== --- trunk/octave-forge/main/control/inst/nichols.m 2010-11-22 17:11:24 UTC (rev 7938) +++ trunk/octave-forge/main/control/inst/nichols.m 2010-11-22 20:12:51 UTC (rev 7939) @@ -68,7 +68,7 @@ plot (pha, mag_db) axis (ax_vec) grid ("on") - title ("Nichols Chart") + title (["Nichols Chart of ", inputname(1)]) xlabel ("Phase [deg]") ylabel ("Magnitude [dB]") else Modified: trunk/octave-forge/main/control/inst/nyquist.m =================================================================== --- trunk/octave-forge/main/control/inst/nyquist.m 2010-11-22 17:11:24 UTC (rev 7938) +++ trunk/octave-forge/main/control/inst/nyquist.m 2010-11-22 20:12:51 UTC (rev 7939) @@ -67,7 +67,7 @@ plot (re, im, "b", re, -im, "r") axis (ax_vec) grid ("on") - title ("Nyquist Diagram") + title (["Nyquist Diagram of ", inputname(1)]) xlabel ("Real Axis") ylabel ("Imaginary Axis") else Modified: trunk/octave-forge/main/control/inst/pzmap.m =================================================================== --- trunk/octave-forge/main/control/inst/pzmap.m 2010-11-22 17:11:24 UTC (rev 7938) +++ trunk/octave-forge/main/control/inst/pzmap.m 2010-11-22 20:12:51 UTC (rev 7939) @@ -49,7 +49,7 @@ plot (pol_re, pol_im, "xb", zer_re, zer_im, "sr") grid ("on") - title ("Pole-Zero Map") + title (["Pole-Zero Map of ", inputname(1)]) xlabel ("Real Axis") ylabel ("Imaginary Axis") else Modified: trunk/octave-forge/main/control/inst/rlocus.m =================================================================== --- trunk/octave-forge/main/control/inst/rlocus.m 2010-11-22 17:11:24 UTC (rev 7938) +++ trunk/octave-forge/main/control/inst/rlocus.m 2010-11-22 20:12:51 UTC (rev 7939) @@ -294,7 +294,7 @@ legend ("boxon", 2); grid ("on"); axis (axlim); - title ("Root Locus"); + title (["Root Locus of ", inputname(1)]); xlabel (sprintf ("Real Axis gain = [%g, %g]", gvec(1), gvec(ngain))); ylabel ("Imaginary Axis"); set (gcf (), "visible", "on"); Modified: trunk/octave-forge/main/control/inst/sigma.m =================================================================== --- trunk/octave-forge/main/control/inst/sigma.m 2010-11-22 17:11:24 UTC (rev 7938) +++ trunk/octave-forge/main/control/inst/sigma.m 2010-11-22 20:12:51 UTC (rev 7939) @@ -92,7 +92,7 @@ ## plot results semilogx (w, sv_db, "b") axis (ax_vec) - title ("Singular Values") + title (["Singular Values of ", inputname(1)]) xlabel (xl_str) ylabel ("Singular Values [dB]") grid ("on") Modified: trunk/octave-forge/main/control/inst/step.m =================================================================== --- trunk/octave-forge/main/control/inst/step.m 2010-11-22 17:11:24 UTC (rev 7938) +++ trunk/octave-forge/main/control/inst/step.m 2010-11-22 20:12:51 UTC (rev 7939) @@ -64,7 +64,7 @@ print_usage (); endif - [y, t, x] = __time_response__ (sys, "step", ! nargout, tfinal, dt); + [y, t, x] = __time_response__ (sys, "step", ! nargout, tfinal, dt, [], inputname(1)); if (nargout) y_r = y; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |