--- a/inst/@ss/__sys_prune__.m
+++ b/inst/@ss/__sys_prune__.m
@@ -1,4 +1,4 @@
-## Copyright (C) 2009, 2010   Lukas F. Reichlin
+## Copyright (C) 2009, 2010, 2013   Lukas F. Reichlin
 ##
 ## This file is part of LTI Syncope.
 ##
@@ -22,11 +22,18 @@
 
 ## Author: Lukas Reichlin <lukas.reichlin@gmail.com>
 ## Created: September 2009
-## Version: 0.2
+## Version: 0.3
 
 function sys = __sys_prune__ (sys, out_idx, in_idx, st_idx = ":")
 
-  sys.lti = __lti_prune__ (sys.lti, out_idx, in_idx);
+  [sys.lti, out_idx, in_idx] = __lti_prune__ (sys.lti, out_idx, in_idx);
+  
+  if (ischar (st_idx) && ! strcmp (st_idx, ":"))
+    st_idx = {st_idx};
+  endif
+  if (iscell (st_idx))
+    st_idx = cellfun (@(x) __str2idx__ (sys.stname, x), st_idx);
+  endif
 
   sys.a = sys.a(st_idx, st_idx);
   sys.b = sys.b(st_idx, in_idx);
@@ -40,3 +47,19 @@
   sys.stname = sys.stname(st_idx);
 
 endfunction
+
+
+function idx = __str2idx__ (name, str)
+
+  tmp = strcmp (name, str)(:);
+
+  switch (nnz (tmp))
+    case 1
+      idx = find (tmp);
+    case 0
+      error ("ss: state name '%s' not found", str);
+    otherwise
+      error ("ss: state name '%s' is ambiguous", str);
+  endswitch
+
+endfunction