# HG changeset patch # User jwe # Date 815182799 0 # Node ID 4da3d91d1a17242347bac7194c3277deb37fc135 # Parent 2790524e19321ac01e15243a720c912389bfc52c [project @ 1995-10-31 23:39:59 by jwe] diff --git a/liboctave/Array-idx.h b/liboctave/Array-idx.h --- a/liboctave/Array-idx.h +++ b/liboctave/Array-idx.h @@ -608,16 +608,35 @@ if (len > 0) { - if (pcv_flag) + int idx_nr = idx.orig_rows (); + int idx_nc = idx.orig_columns (); + + if (dfi_flag || (idx_nr == 1 && idx_nc == 1)) + { + if (pcv_flag) + { + lhs.d1 = lhs.length (); + lhs.d2 = 1; + } + else + { + lhs.d1 = 1; + lhs.d2 = lhs.length (); + } + } + else if (idx_nr == 1 && rhs_nr == 1) + { + lhs.d1 = 1; + lhs.d2 = lhs.length (); + } + else if (idx_nc == 1 && rhs_nc == 1) { lhs.d1 = lhs.length (); lhs.d2 = 1; } else - { - lhs.d1 = 1; - lhs.d2 = lhs.length (); - } + (*current_liboctave_error_handler) + ("A(I) = X: X must be a scalar or a matrix with the same size as I"); } else {