Adding zeros to a number

8 次查看(过去 30 天)
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

采纳的回答

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

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Loops and Conditional Statements 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by