From: <par...@us...> - 2011-10-17 18:35:29
|
Revision: 8764 http://octave.svn.sourceforge.net/octave/?rev=8764&view=rev Author: paramaniac Date: 2011-10-17 18:35:22 +0000 (Mon, 17 Oct 2011) Log Message: ----------- control: fix nasty bug in tfpoly Modified Paths: -------------- trunk/octave-forge/main/control/inst/@tfpoly/__remove_leading_zeros__.m Modified: trunk/octave-forge/main/control/inst/@tfpoly/__remove_leading_zeros__.m =================================================================== --- trunk/octave-forge/main/control/inst/@tfpoly/__remove_leading_zeros__.m 2011-10-17 18:07:58 UTC (rev 8763) +++ trunk/octave-forge/main/control/inst/@tfpoly/__remove_leading_zeros__.m 2011-10-17 18:35:22 UTC (rev 8764) @@ -1,4 +1,4 @@ -## Copyright (C) 2009 Lukas F. Reichlin +## Copyright (C) 2009, 2011 Lukas F. Reichlin ## ## This file is part of LTI Syncope. ## @@ -21,13 +21,15 @@ ## Author: Lukas Reichlin <luk...@gm...> ## Created: September 2009 -## Version: 0.1 +## Version: 0.2 function p = __remove_leading_zeros__ (p) idx = find (p.poly != 0); - if (! isempty (idx) && idx(1) > 1) + if (isempty (idx)) + p.poly = 0; + else p.poly = p.poly(idx(1) : end); # p.poly(idx) would remove all zeros endif This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |