How can I change the first row of my matrix to all 0s using a for loop?

12 visualizaciones (últimos 30 días)
Erin Keown
Erin Keown el 26 de Oct. de 2020
Comentada: Erin Keown el 26 de Oct. de 2020
I need to change the first row of my matrix of dimensions ones[5,567] to all zeros, but leave the rest as all ones. How can I do that using a for loop?

Respuestas (1)

Stephen23
Stephen23 el 26 de Oct. de 2020
Where M is your matrix:
M(1,:) = 0;

Categorías

Más información sobre Multidimensional Arrays en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by