필터 지우기
필터 지우기

how to get the time long after decimal point

조회 수: 1 (최근 30일)
singh
singh 2015년 6월 14일
편집: Jan 2015년 6월 14일
format longg
t=clock;
t1 = t([5,6]);
this code output is min(21) sec(19.955) now i wish to get after decimal point more than 5 digit and both minute and second will be show. is it possible

답변 (2개)

Azzi Abdelmalek
Azzi Abdelmalek 2015년 6월 14일
편집: Azzi Abdelmalek 2015년 6월 14일
it's format long, with one g
format long
t=clock;
t1 = t([5,6])
  댓글 수: 1
Jan
Jan 2015년 6월 14일
편집: Jan 2015년 6월 14일
"longG" is fine according to doc format . It works in lower case and with a space also:
format long g

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


Jan
Jan 2015년 6월 14일
The format command influences the output in the command window in general. When you want to modify a specific variable only, use sprintf or fprintf:
t = clock;
t1 = t(5:6);
fprintf('%.5f min %.5f sec\n', t1);

카테고리

Help CenterFile Exchange에서 Data Type Conversion에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by