Octave | Matlab | remarks |
---|---|---|
\ or ... |
... |
catenate following line; Emacs don't respond nice on ...
|
# or % |
% |
start comment on a line; Emacs don't respond nice on %
|
"txt" or 'txt' |
'txt' |
text txt ; Emacs don't respond nice on Matlab's version |
yes | no | end-of-function required to close a function |
yes | no | function definition allowed in script file |
exist("in")==0 |
in==[] |
check existence of input in: function f = fnname(in) |
end |
last element in a vector: a=0:5; a(end) |
|
x |
[t,x] |
result of ODE-solver: x = lsode("nm",x0,t)
versus [t,x] = ode45("nm",t,x0) |
(x,t) |
(t,x) |
arguments for user defined functions for ODE-solver.
Matlab's output t and x are large
if the input t has 2 elements. |
[x,err] |
[x,flag,err] |
result of root finder: fsolve("name",x0) |
e^() or exp() |
exp() |
exponent |
!= or ~= |
~= |
is not equal to |
x=y=1; |
x=1;y=1; |
Octave's shortcut not allowed in Matlab |
i++; |
i=i+1; |
Octave's shortcut not allowed in Matlab |
clear |
clear all |
erase all variables |
clg |
clf |
clear plot |
clear
does not affect the values of global variables inside
functionsrotate3D
which
allows the users to rotate a 3-dim plot with the mouse. multiplot
in Octave,
directly call subplot
in MatlabLOADPATH=" ";
under Octave
and in the menu-bar under Matlab
The Student Edition of Matlab is sufficient for most applications,
although it has the problem of an upper boundary of array sizes, which
is easily exceeded when integrating a system over a longer time
interval. Another problem is that the Student Edition has no routine
for solving vector-valued x
from 0 =
f(x)
. If you go for the professional edition of Matlab, you
will probably also need the optimization toolbox, which comes under a
separate license requirement.