next up previous contents
Next: EIGS Sparse Matrix Eigendecomposition Up: Sparse Matrix Support Previous: SPARSE Construct a Sparse   Contents

Subsections

FULL Convert Sparse Matrix to Full Matrix

Usage

Converts a sparse matrix to a full matrix. The syntax for its use is

   y = full(x)

The type of x is preserved. Be careful with the function. As a general rule of thumb, if you can work with the full representation of a function, you probably do not need the sparse representation.

Example

Here we convert a full matrix to a sparse one, and back again.

--> a = [1,0,4,2,0;0,0,0,0,0;0,1,0,0,2]
a = 
  <int32>  - size: [3 5]
 
Columns 1 to 5
             1              0              4              2              0  
             0              0              0              0              0  
             0              1              0              0              2  
--> A = sparse(a)
A = 
  <int32>  - size: [3 5]
	Matrix is sparse with 5 nonzeros
--> full(A)
ans = 
  <int32>  - size: [3 5]
 
Columns 1 to 5
             1              0              4              2              0  
             0              0              0              0              0  
             0              1              0              0              2



Samit K. Basu 2005-03-16