spZeros¶
Purpose¶
Creates a sparse matrix containing no non-zero values.
Format¶
-
y =
spZeros
(r, c)¶ - Parameters
r (scalar) – rows of output matrix.
c (scalar) – columns of output matrix.
- Returns
y (RxC sparse matrix) – sparse matrix containing no non-zero values.
Examples¶
sparse matrix y;
// Create a 4x3 sparse matrix with all elements set to 0
y = spZeros(4, 3);
// Create a dense matrix with the same values as 'y'
d = spToDense(y);
The contents of d are equal to:
0 0 0
0 0 0
0 0 0
0 0 0