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.
sqr = @(x) x.^2;
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)