help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: operation x=x(:)


From: John W. Eaton
Subject: Re: operation x=x(:)
Date: Thu, 6 May 1999 14:34:51 -0500 (CDT)

On  6-May-1999, (Ted Harding) <address@hidden> wrote:

| On 06-May-99 John Logsdon wrote:
| > On Wed, 5 May 1999, John W. Eaton wrote:
| > 
| > I thought to get close to Matlab compatability you *had* to have
| > do_fortran_indexing set to 1 (best in .octaverc)
| > 
| >> Perhaps this could be `fixed' for 2.1.x so that it always does the
| >> Matlab-compatible thing.  Does anyone have a strong opinion either
| >> way?
| >> 
| > 
| > It is already, surely.  I see no need as there may be code out there
| > that
| > uses the opposite sense with do_fortran_indexing=0
| > 
| >> Thanks,
| >> 
| >> jwe
| 
| I'm inclined to agree with John Logsdon on this one.
| 
| However, I think the following would be really useful.
| 
| It has never been really clear what you need to set if you want, for
| whatever reason, MatLab compatibility (interoperability with MatLab
| users being a compelling reason).

The manual lists them with the desription of the --traditional
command-line option:

`--traditional'
`--braindead'
     Set initial values for user-preference variables to the following
     values for compatibility with MATLAB.

          PS1                           = ">> "
          PS2                           = ""
          beep_on_error                 = 1
          default_save_format           = "mat-binary"
          define_all_return_values      = 1
          do_fortran_indexing           = 1
          crash_dumps_octave_core       = 0
          empty_list_elements_ok        = 1
          implicit_str_to_num_ok        = 1
          ok_to_lose_imaginary_part     = 1
          page_screen_output            = 0
          prefer_column_vectors         = 0
          print_empty_dimensions        = 0
          treat_neg_dim_as_zero         = 1
          warn_function_name_clash      = 0
          whitespace_in_literal_matrix  = "traditional"

Unfortunately, this list is slightly out of date.  The correct
information is in the function maximum_braindamage, which is defined
in octave.cc.  Recent additions are

  default_eval_print_flag       = 0
  default_global_variable_value = []
  fixed_point_format            = 1
  implicit_num_to_str_ok        = 1
  initialize_global_variables   = 1
  prefer_zero_one_indexing      = 1

(My apologies for letting the documentation slip a bit.)

| Maybe the whole thing could be wrapped up in an option
| 
| "matlab_compatibility = 1"

It would be trivial to add a function that simply set the appropriate
variables to the values they would have on --traditional.

| (though I deeply appreciate that it can be decidedly
| non-trivial to set one package up to be totally compatible with another,
| especially since this can, in the long term, involve you in
| "feature-tracking" when you may have better things to do).

Right.  It's a losing battle, especially when many of the new features
tend to be poorly designed.

I never set out to write a `Matlab clone' and have never called Octave
that.  The reason for choosing a mostly compatible syntax was to make
it easier for Matlab users to learn.

jwe




reply via email to

[Prev in Thread] Current Thread [Next in Thread]