Matlab

Posted by ECON爱好者 on September 10, 2016

Matlab Programming

Logical indexing

Save time to avoid loop.

Preallocation

time

tic;sum(1:1e3);toc

Save time to avoid allocate every time.

A = zeros(N,N); If no preallocation, every time matrix A change size.