||Department of Engineering
Next: File Input/Output
Up: Using Matlab at CUED
Previous: Creating User Interfaces
If you know that your matrices will stay nearly empty, then make
% comparison of sparse vs full matrices
% Create sparse and full versions of the same matrix.
% Note that the density is 0.05. The break-even point
% for this operation seems to be about 0.25.
S = sprandn(60,60,0.05);
F = full(S);
% Compare speed.
B = S * S;
C = F * F;