Mercurial > forge
changeset 8657:89902dab4d9e octave-forge
control: add a few comments
author | paramaniac |
---|---|
date | Sat, 22 Oct 2011 04:07:40 +0000 |
parents | 972f8fc7b2b3 |
children | 35805dae94ae |
files | main/control/inst/@tf/__sys2ss__.m |
diffstat | 1 files changed, 4 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/main/control/inst/@tf/__sys2ss__.m Fri Oct 21 22:00:45 2011 +0000 +++ b/main/control/inst/@tf/__sys2ss__.m Sat Oct 22 04:07:40 2011 +0000 @@ -44,7 +44,7 @@ ## check for properness ## tfpoly ensures that there are no leading zeros tmp = len_num > len_den; - if (any (tmp(:))) + if (any (tmp(:))) # non-proper transfer function ## separation into strictly proper and polynomial part [numq, numr] = cellfun (@deconv, num, den, "uniformoutput", false); numq = cellfun (@__remove_leading_zeros__, numq, "uniformoutput", false); @@ -63,12 +63,12 @@ b = vertcat (b1, b2); c = horzcat (c1, c2); retsys = dss (a, b, c, [], e); - else + else # proper transfer function [a, b, c, d] = __proper_tf2ss__ (num, den, p, m); retsys = ss (a, b, c, d); endif - retlti = sys.lti; # preserve lti properties such as tsam + retlti = sys.lti; # preserve lti properties such as tsam endfunction @@ -155,6 +155,7 @@ endfunction +## remove leading zeros from polynomial vector function p = __remove_leading_zeros__ (p) idx = find (p != 0);