필터 지우기
필터 지우기

Too many digit numbers in MATLAB strings?

조회 수: 2 (최근 30일)
Steven
Steven 2014년 2월 6일
댓글: Walter Roberson 2014년 2월 6일
Hi
I am using strings in a format like:
sprintf('image-%f-%d.jpeg'),i,j)
but it writes the files for me in long digits, for the first one! I mean the output is:
image-14.000000-2
How can I fix this? I just want something like: image-14-2
and why does it so?
Thanks so much
Steven

채택된 답변

Walter Roberson
Walter Roberson 2014년 2월 6일
sprintf('image-%d-%d.jpeg',i,j)
  댓글 수: 2
Steven
Steven 2014년 2월 6일
Thanks Walter!
But what is the difference? I want to understand why and how it works.
Thanks so much again.
Steven
Walter Roberson
Walter Roberson 2014년 2월 6일
%d displays integral values. %f displays fixed-point values.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Get Started with MATLAB에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by