Hints for C Users
Some advice to users of C (or C++):
- You don't have to declare your variables.
- Semicolons on the end of lines suppress output.
- Use & and | instead of && and ||.
- To get bitwise operations (& and | in C),
see this link.
- Everything is stored as a 2-dimensional array of data.
- Use parentheses to index into matrices, not brackets, and use
A(i, j), not A[i][j].
- All the operators are overloaded to work with matrices.
- The comment symbol is % and behaves like //.
- The output of Matlab functions can be assigned to vectors of variables,
and often this is the only way to coerce the function to return certain
outputs.
- In general, Matlab commands cannot span multiple lines unless you are using
bracket notation to enter a matrix,
or if you type the continuation operator ... before you press
Enter.