Replace the first row of the matrix with zeros.

61 vues (au cours des 30 derniers jours)
Wei Ding
Wei Ding le 31 Août 2017
Hi! I am quite new in Matlab and really don't know how to replace the first row of this matrix with zeros, please help me. 1 2 3 2 3 4 3 4 5 6 7 8 9 10 11 12 13 14

Réponse acceptée

Ryan Klots
Ryan Klots le 31 Août 2017
Modifié(e) : Ryan Klots le 31 Août 2017
You could try something like
% A is the name of your matrix
% n is the number of columns in your matrix
A(1, :) = zeros(1, n)
  1 commentaire
Wei Ding
Wei Ding le 31 Août 2017
Thank you!It works!

Connectez-vous pour commenter.

Plus de réponses (1)

James Cai
James Cai le 17 Avr 2020
A(1, :) = 0

Catégories

En savoir plus sur Get Started with MATLAB 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