필터 지우기
필터 지우기

convert double to string!

조회 수: 1,133 (최근 30일)
fatemeh
fatemeh 2013년 12월 29일
댓글: Azzi Abdelmalek 2013년 12월 29일
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?

채택된 답변

Azzi Abdelmalek
Azzi Abdelmalek 2013년 12월 29일
a=0.222833
a=sprintf('%.6f',a)
  댓글 수: 2
fatemeh
fatemeh 2013년 12월 29일
thank you very much
Azzi Abdelmalek
Azzi Abdelmalek 2013년 12월 29일
%or
b=sprintf('%.20f',a);
idx=regexp(b,'0+','start');
b(idx(end):end)=[]

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Characters and Strings에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by