MATLAB: Difference between revisions

From David's Wiki
No edit summary
No edit summary
Line 2: Line 2:
Students are usually forced to use it in introductory math classes.<br>
Students are usually forced to use it in introductory math classes.<br>
Unless required to use Matlab, I recommend using Python, Julia, or R which are all free and, in my opinion, more flexable.<br>
Unless required to use Matlab, I recommend using Python, Julia, or R which are all free and, in my opinion, more flexable.<br>
For optimal CPU performance, you can also use C++ with [[Eigen]].





Revision as of 17:46, 1 October 2019

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)