Mercurial > hg > octave-lyh
changeset 2269:517a43164a60
[project @ 1996-05-24 01:50:09 by jwe]
author | jwe |
---|---|
date | Fri, 24 May 1996 01:53:00 +0000 |
parents | ee5ec3133ed3 |
children | cfcf8ff7d2dd |
files | scripts/general/reshape.m scripts/strings/deblank.m src/pt-const.cc |
diffstat | 3 files changed, 13 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- a/scripts/general/reshape.m +++ b/scripts/general/reshape.m @@ -30,13 +30,19 @@ else [nr, nc] = size (a); if (nr * nc == m * n) - tmp = do_fortran_indexing; + dfi = do_fortran_indexing; + istno = implicit_str_to_num_ok; unwind_protect - do_fortran_indexing = "true"; + do_fortran_indexing = 1; + implicit_str_to_num_ok = 1; retval = zeros (m, n); retval (:) = a; + if (isstr (a)) + retval = setstr (retval); + endif unwind_protect_cleanup - do_fortran_indexing = tmp; + do_fortran_indexing = dfi; + implicit_str_to_num_ok = istno; end_unwind_protect else error ("reshape: sizes must match");
--- a/scripts/strings/deblank.m +++ b/scripts/strings/deblank.m @@ -36,10 +36,9 @@ if (len == 0) t = s; else - s = toascii (s); s = reshape (s, 1, len); - k = max (find (s != toascii (" "))); - t = setstr (s (1:k)); + k = max (find (s != " ")); + t = s (1:k); endif else
--- a/src/pt-const.cc +++ b/src/pt-const.cc @@ -3055,7 +3055,7 @@ && (rhs_tmp.is_string () || rhs_tmp.is_zero_by_zero ()))) { - rhs_tmp.force_numeric (); + rhs_tmp = rhs_tmp.make_numeric (); if (error_state) return; @@ -3065,7 +3065,7 @@ && rhs_tmp.rows () == 1 && rhs_tmp.columns () == 0) { - rhs_tmp.force_numeric (1); + rhs_tmp = rhs_tmp.make_numeric (1); if (error_state) return;