Adding zeros to a number

8 vues (au cours des 30 derniers jours)
WhatIsMatlab-
WhatIsMatlab- le 20 Fév 2016
Commenté : WhatIsMatlab- le 20 Fév 2016
So I have this number 0 1 0 1 0 it is only 5 bits long but I want to add all zeros to the end of the number to make it 23 bits long. I have played around with this some but I cannot seem to get it to add zeros to the end of the number.
Thanks

Réponse acceptée

Walter Roberson
Walter Roberson le 20 Fév 2016
A = [0 1 0 1 0];
A = [A, zeros(1, 23-length(A))];
  1 commentaire
WhatIsMatlab-
WhatIsMatlab- le 20 Fév 2016
Thank you!!

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Loops and Conditional Statements dans Help Center et File Exchange

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by