"I wrote some code for MATLAB, and I want to get it running under Octave. Is there anything I should watch out for?"
The differences between Octave and MATLAB typically fall into one of three categories:
The first category, irrelevant differences, do not affect computations and most likely do not affect the execution of function files. Some examples are:
When typing `help function', Octave displays the first set of comment lines after the function declaration, but MATLAB the first set of comment lines starting from the beginning of the file.
The differences of the second category are usually because the authors of Octave decided on a better (subjective) implementation that the way MATLAB does it, and so introduced "user preference variables" so that you can customize Octave's behavior to be either MATLAB-compatible or to use Octave's new features. To make Octave more MATLAB-compatible, put the following statements in your `~/.octaverc' file. This is a partial list of the user preference variables that should be changed to get MATLAB-compatible behavior. (It is partial because not all the differences are currently known, and when they become known, this document lags behind.)
do_fortran_indexing = 'true'; treat_neg_dim_as_zero = 'true'; empty_list_elements_ok = 'true'; implicit_str_to_num_ok = 'true'; whitespace_in_literal_matrix = 'traditional'; prefer_zero_one_indexing = 'true';
Some other known differences are:
a = 'reknob'; a([6,1,5,3,2,4])returns the string `broken' in MATLAB, but generates an error in Octave. A future release of Octave will fix this along with providing a much more complete and powerful set of functions for manipulating strings.
The third category of differences is (hopefully) shrinking. If you find a difference between Octave behavior and MATLAB, then you should send a description of this difference (with code illustrating the difference, if possible) to firstname.lastname@example.org.
An archive of old postings to the Octave mailing lists is maintained on ftp.che.utexas.edu in the directory `/pub/octave/MAILING-LISTS'.