changeset 11118:ef6fa73519ab octave-forge

control: make a highly sophisticated function even more sophisticated ;-)
author paramaniac
date Thu, 18 Oct 2012 16:37:33 +0000
parents 295a5b2520ac
children d38bd3e0ab9c
files main/control/inst/@lti/size_equal.m
diffstat 1 files changed, 2 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/main/control/inst/@lti/size_equal.m	Thu Oct 18 16:15:01 2012 +0000
+++ b/main/control/inst/@lti/size_equal.m	Thu Oct 18 16:37:33 2012 +0000
@@ -18,7 +18,7 @@
 ## -*- texinfo -*-
 ## @deftypefn {Function File} {@var{bool} =} size_equal (@var{a}, @var{b}, @dots{})
 ## Return true if LTI models (and matrices) @var{a}, @var{b}, @dots{}
-## are of equal size.
+## are of equal size and false otherwise.
 ## @end deftypefn
 
 ## Author: Lukas Reichlin <lukas.reichlin@gmail.com>
@@ -29,10 +29,6 @@
 
   s = cellfun (@size, varargin, "uniformoutput", false);
   
-  if (numel (s) == 1 || isequal (s{:}))  # isequal errors out with only 1 argument, numel(s)==0 handled by built-in size_equal
-    bool = true;
-  else
-    bool = false;
-  endif
+  bool = (nargin == 1 || isequal (s{:}));  # isequal errors out with only 1 argument, nargin==0 handled by built-in size_equal
 
 endfunction