MATLAB

From David's Wiki
Jump to navigation Jump to search

Matlab is a commercial numerical computing language which costs $149.
Students are usually forced to use it in introductory math classes.
Unless required to use Matlab, I recommend using Python, Julia, or R which are all free and, in my opinion, more flexable.
For optimal CPU performance, you can also use C++ with Eigen.


Usage

Anonymous Functions

Reference

sqr = @(x) x.^2;

Timing Code

Reference
tic starts a timer. toc returns the time elapsed in seconds since the started timer.

timerVal = tic
   % The program section to time. 
elapsedTime = toc(timerVal)