Skip to content

full

Convert a sparse matrix to full storage.

f = full(s)

Returns a full (dense) matrix containing the same values as the sparse matrix s. Already-full inputs are returned unchanged. The result occupies storage proportional to numel(s), so converting a large mostly-zero sparse matrix can blow up memory — use only when the dense form is genuinely needed.

S = sparse([1 2], [1 2], [10 20]);
full(S) % [10 0; 0 20]
  • sparse — Create a sparse matrix.
  • issparse — Test whether the input is a sparse matrix.