Mercurial > forge
changeset 8278:c5f321944a74 octave-forge
control: display whether tf is static, continuous- or discrete-time
author | paramaniac |
---|---|
date | Tue, 16 Aug 2011 09:47:35 +0000 |
parents | d29d12e9cff1 |
children | d469e79b6758 |
files | main/control/doc/NEWS main/control/inst/@tf/display.m |
diffstat | 2 files changed, 13 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/main/control/doc/NEWS Mon Aug 15 21:24:46 2011 +0000 +++ b/main/control/doc/NEWS Tue Aug 16 09:47:35 2011 +0000 @@ -8,6 +8,7 @@ -- State-space to transfer function conversion uses now SLICOT TB04BD. Conversion of MIMO models is now supported. Usage: tf_sys = tf (ss_sys) -- Display an empty line between title and numerator for better readability. + -- Display whether model is static, continuous- or discrete-time. ===============================================================================
--- a/main/control/inst/@tf/display.m Mon Aug 15 21:24:46 2011 +0000 +++ b/main/control/inst/@tf/display.m Tue Aug 16 09:47:35 2011 +0000 @@ -1,4 +1,4 @@ -## Copyright (C) 2009, 2010 Lukas F. Reichlin +## Copyright (C) 2009, 2010, 2011 Lukas F. Reichlin ## ## This file is part of LTI Syncope. ## @@ -20,12 +20,12 @@ ## Author: Lukas Reichlin <lukas.reichlin@gmail.com> ## Created: September 2009 -## Version: 0.2 +## Version: 0.3 function display (sys) sysname = inputname (1); - [inname, outname] = __lti_data__ (sys.lti); + [inname, outname, tsam] = __lti_data__ (sys.lti); [inname, m] = __labels__ (inname, "u"); [outname, p] = __labels__ (outname, "y"); @@ -40,7 +40,15 @@ endfor endfor - display (sys.lti); + display (sys.lti); # display sampling time + + if (tsam == -2) + disp ("Static gain."); + elseif (tsam == 0) + disp ("Continuous-time model."); + else + disp ("Discrete-time model."); + endif endfunction