 |
Improving the Speed of MATLAB Calculations
Using vector operations instead of loops Consider the following loop, translated directly from Fortran or C dx = pi/30; nx = 1 + 2*pi/dx; for i = 1:nx x(i) = (i-1)*dx; y(i) = sin(3*x(i)); end The preceding statements are perfectly legal MATLAB statements,
web.cecs.pdx.edu |
 |