Mercurial > octave-nkf
comparison 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 |
comparison
equal
deleted
inserted
replaced
13695:348857854c52 | 13696:d6118a2c0644 |
---|---|
1954 else | 1954 else |
1955 retval = octave_fcn_handle::do_multi_index_op (nargout, args, lvalue_list); | 1955 retval = octave_fcn_handle::do_multi_index_op (nargout, args, lvalue_list); |
1956 | 1956 |
1957 return retval; | 1957 return retval; |
1958 } | 1958 } |
1959 | |
1960 /* | |
1961 %!function r = f (g, i) | |
1962 %! r = g(i); | |
1963 %!endfunction | |
1964 %!test | |
1965 %! x = [1,2;3,4]; | |
1966 %! assert (f (@(i) x(:,i), 1), [1;3]); | |
1967 */ |