How do I format an array of values to a specific number of digits?
조회 수: 15 (최근 30일)
이전 댓글 표시
I've got a 5 X 1 double array that looks like this;
>> Y = [1;2;3;4;5];
>> Y
Y =
1
2
3
4
5
I want to format the contents of Y such that they are;
01
02
03
04
05
Can this be done for an array of values? I've used fprintf for writing formatted data to text file. But it appears this won't work for an array.
Thank you.
댓글 수: 1
Jan
2016년 2월 23일
Why do you assume, that this does not work? The core of this question is hidden in this sentencs. So please provide the details.
채택된 답변
추가 답변 (1개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Data Type Conversion에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!