`(y)=sprand(rows, columns, density)`

Inputs | |

`rows` |
The number of rows in the sparse matrix to be constructed |

`columns` |
The number of columns in the sparse matrix to be constructed. |

`density` |
The density of the sparse matrix to be constructed. A number less than one. |

The number of nonzero elements in the output is approximately

`density*rows*columns`

.
>>sprand(20,20,.02)( 3, 5) 0.0127 ( 5, 6) 0.5322 ( 1, 10) 0.1645 ( 8, 10) 0.6394 ( 14, 11) 0.1227 ( 6, 12) 0.9349 ( 20, 14) 0.2956 ( 8, 15) 0.7749