Department of Engineering
University of Cambridge
>
Engineering Department
>
computing help
Next:
Numerical Analysis
Up:
Miscellaneous
Previous:
Saving and Loading figures
Optimising
Functions are faster than scripts - they get compiled internally the first time they are run.
Use vectorised operations instead of
for
loops.
If you know the maximum size that a matrix will be, create it that size, rather than letting it grow incrementally.
Use
pack
every so often to tidy up memory usage.
Use sparse matrices when you can. They may save you a great deal of space and time.
|
computing help
|
©
Cambridge University Engineering Dept
Information provided by
Tim Love
2006-07-24