convert double to string!
조회 수: 1,133 (최근 30일)
이전 댓글 표시
I want convert double number like 0.222833 to string but when i using num2str the number convert to '0.22283' and sixth digit of number is removed ,can u help me to convert it to string?
댓글 수: 0
채택된 답변
Azzi Abdelmalek
2013년 12월 29일
a=0.222833
a=sprintf('%.6f',a)
댓글 수: 2
Azzi Abdelmalek
2013년 12월 29일
%or
b=sprintf('%.20f',a);
idx=regexp(b,'0+','start');
b(idx(end):end)=[]
추가 답변 (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!