|
"DADiSP inspired everyone and produced radical shifts in thinking." |
| Download Now | Pricing / Purchase  |
Operation |
MATLAB |
C/C++ |
SPL |
|---|---|---|---|
| scalar or series multiply | a .* b | a * b | a * b a .* b |
| scalar or series divide | a ./ b | a / b | a / b a ./ b |
| matrix multiply | a * b | N/A | a *^ b |
| matrix divide | a \ b | N/A | a \^ b |
| matrix transpose | a' | N/A | a' |
| block statement | begin, end | {} | {} |
| range specifier | 1:10 | N/A | 1..10 |
| series constructor | [1,2] | {1,2} | {1,2} |
| array constructor | [1,2;3,4] | {{1,2}, {3,4}} | {{1,2}, {3,4}} |
| array reference | a(n,m) | a[n][m] | a[n][m] a[n,m] |
| function call | f(x,y) | f(x,y) | f(x,y) |
| iteration | for 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 statements | goto switch | goto switch | goto switch |
| input arg count | nargin | argc | argc |
| output arg count | nargout | N/A | outargc |
| string character | 'text' | "text" | "text" 'text' |
| pre/postfix | N/A | a++ 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/A | return(a,b) |
| assignments | 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 a @= b a := b |
| address | N/A | &a | &a |
| pointer reference | N/A | *a | *a |
| logicals | a | b a & b | a || b a && b | a || b a && b |
| relationals | a > b a < b a >= b a <= b | a > b a < b a >= b a <= b | a > b a < b a >= b a <= b |
| equalities | a == b a ~= b | a == b a != b | a == b a != b |
| bit operators | N/A | a << b a >> b a <<= b a >>= b | a << b a >> b a <<= b a >>= b |
| modulus | N/A | a % b | a % b |
| comment | % text | // text /* text */ | // text /* text */ |
| preprocessor | N/A | #if #ifdef #elif #endif | #if #ifdef #elif #endif |
| file inclusion | N/A | #include | #include |
| macros | N/A | #define #else #elif #endif #undef | #define #else #elif #endif #undef |
| ternary conditional | N/A | a ? b : c | a ? b : c |