diff src/ov-fcn-handle.cc @ 13696:d6118a2c0644

fix indexing bug for matrices inside anonymous functions * ov-base-mat.h (octave_base_matrix<T>::do_multi_index_op): New method. * ov-fcn-handle.cc: New test.
author John W. Eaton <jwe@octave.org>
date Thu, 13 Oct 2011 11:05:30 -0400
parents a00ff5cedb9b
children 4e8f23ccadce
line wrap: on
line diff
--- a/src/ov-fcn-handle.cc	Wed Oct 12 22:25:01 2011 -0400
+++ b/src/ov-fcn-handle.cc	Thu Oct 13 11:05:30 2011 -0400
@@ -1956,3 +1956,12 @@
 
   return retval;
 }
+
+/*
+%!function r = f (g, i)
+%!  r = g(i);
+%!endfunction
+%!test
+%! x = [1,2;3,4];
+%! assert (f (@(i) x(:,i), 1), [1;3]);
+*/