Mercurial > hg > octave-lyh
diff src/ov-base.cc @ 4436:689f730954b3
[project @ 2003-06-24 13:00:12 by jwe]
author | jwe |
---|---|
date | Tue, 24 Jun 2003 13:00:12 +0000 |
parents | 83d4452bc522 |
children | f3c21a1d1c62 |
line wrap: on
line diff
--- a/src/ov-base.cc +++ b/src/ov-base.cc @@ -114,6 +114,17 @@ { if (type.length () == 1) retval = numeric_assign (type, idx, rhs); + else if (is_empty ()) + { + // Allow conversion of empty matrix to some other + // type in cases like + // + // x = []; x(i).f = rhs + + octave_value tmp = octave_value::empty_conv (type, rhs); + + retval = tmp.subsasgn (type, idx, rhs); + } else { std::string nm = type_name ();