Adding zeros to a number

15 Ansichten (letzte 30 Tage)
WhatIsMatlab-
WhatIsMatlab- am 20 Feb. 2016
Kommentiert: WhatIsMatlab- am 20 Feb. 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

Akzeptierte Antwort

Walter Roberson
Walter Roberson am 20 Feb. 2016
A = [0 1 0 1 0];
A = [A, zeros(1, 23-length(A))];

Weitere Antworten (0)

Kategorien

Mehr zu Loops and Conditional Statements finden Sie in Help Center und File Exchange

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by