How to Keep a Character in A Fixed Position?
조회 수: 1 (최근 30일)
이전 댓글 표시
I have created a Static Text that shows the current values of A and B:
A: 1 B: 2
When A’s value has more than one digit, it pushes B forward, and therefore B is no longer in its previous location:
A: 1234567 B: 2
Is there any trick to hold B in a fixed position regardless of the number of A’s digits? So it would like that:
A: 1 B: 2
A: 1234567 B: 2
댓글 수: 0
답변 (1개)
Chad Greene
2017년 3월 17일
편집: Chad Greene
2017년 3월 17일
Try this:
A = 1;
sprintf('% 8d',A)
B = 1234567;
sprintf('% 8d',B)
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Characters and Strings에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!