Download Now | Pricing / Purchase 

DADiSP SPL vs. MATLAB

Operator and Syntax Comparision of MATLAB, C/C++ and SPL.



  Operation
MATLAB
C/C++
SPL
scalar or series multiplya .* ba * ba * b
a .* b
scalar or series dividea ./ ba / ba / b
a ./ b
matrix multiplya * bN/Aa *^ b
matrix dividea \ bN/Aa \^ b
matrix transposea'N/Aa'
block statementbegin, end{}{}
range specifier1:10N/A1..10
series constructor[1,2]{1,2}{1,2}
array constructor[1,2;3,4]{{1,2},
 {3,4}}
{{1,2},
 {3,4}}
array referencea(n,m)a[n][m]a[n][m]

a[n,m]
function callf(x,y)f(x,y)f(x,y)
iterationfor n:100 end

while n < 100 end
for (n=0; n <= 100; n++)

while (n < 100)

do { } while (n < 100)
for (n=0; n <= 100; n++)

while (n < 100)

do { } while (n < 100)

loop (n..100)
jump statementsgoto
switch
goto
switch
goto
switch
input arg countnarginargcargc
output arg countnargoutN/Aoutargc
string character'text'"text""text"
'text'
pre/postfixN/Aa++
a--
++a
--a
a++
a--
++a
--a
multiple assign[a,b]=f(x)N/A(a,b)=f(x)
multiple return[a,b]=f(x)N/Areturn(a,b)
assignmentsa = ba = b
a += b
a -= b
a /= b
a *= b
a %= b
a = b
a += b
a -= b
a /= b
a *= b
a %= b
a @= b
a := b
addressN/A&a&a
pointer referenceN/A*a*a
logicalsa | b
a & b
a || b
a && b
a || b
a && b
relationalsa > b
a < b
a >= b
a <= b
a > b
a < b
a >= b
a <= b
a > b
a < b
a >= b
a <= b
equalitiesa == b
a ~= b
a == b
a != b
a == b
a != b
bit operatorsN/Aa << b
a >> b
a <<= b
a >>= b
a << b
a >> b
a <<= b
a >>= b
modulusN/Aa % ba % b
comment% text// text
/* text */
// text
/* text */
preprocessorN/A#if
#ifdef
#elif
#endif
#if
#ifdef
#elif
#endif
file inclusionN/A#include#include
macrosN/A#define
#else
#elif
#endif
#undef
#define
#else
#elif
#endif
#undef
ternary conditionalN/Aa ? b : ca ? b : c


SPL vs MATLAB