Replacing n random zeros in a matrix with a specific nonzero value
11 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Jerrold Tubay
il 2 Ott 2020
Commentato: Jerrold Tubay
il 2 Ott 2020
Suppose I start with a zero matrix
X = zeros(100)
How can I replace n random zeros in matrix X with a single nonzero value (e.g., replace 10 zero elements in the matrix X with 1)?
0 Commenti
Risposta accettata
Più risposte (0)
Vedere anche
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!