Replacing n random zeros in a matrix with a specific nonzero value
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Jerrold Tubay
el 2 de Oct. de 2020
Comentada: Jerrold Tubay
el 2 de Oct. de 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 comentarios
Respuesta aceptada
Más respuestas (0)
Ver también
Categorías
Más información sobre Creating and Concatenating Matrices en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!