Here are some codes that Octave allows, but which are not compatible in MATLAB.
Octave users should use MATLAB compatible code, so that their code can run in either Octave or MATLAB
1. In MATLAB, the not equal symbol is ~=. Octave allows either ~= or !=
2. In MATLAB, a function should end with the keyword "end". Octave allows either "end" or "endfunction". By default, Octave inserts "endfunction".
3. In MATLAB, an if logic block of code must end with the keyword "end". Octave allows either "end" or "endif". By default, Octave inserts "endif".You change Octave's default to “end” by doing the following:
From the main window’s top menu bar, click on “editor”, then click on “Preferences”, which is the last in the list of options.
In the preferences window, change ‘Auto insert after “if” etc.’ from endif to end. Then click Okay.