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

11 vues (au cours des 30 derniers jours)
Erin Keown
Erin Keown le 26 Oct 2020
Commenté : Erin Keown le 26 Oct 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?

Réponses (1)

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

Catégories

En savoir plus sur Multidimensional Arrays dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by