Adding zeros to a number

조회 수: 6 (최근 30일)
WhatIsMatlab-
WhatIsMatlab- 2016년 2월 20일
댓글: WhatIsMatlab- 2016년 2월 20일
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