Time in Nano second

조회 수: 8 (최근 30일)
zaini
zaini 2011년 3월 24일
Dear all
how to show time in nano second range, when we use GUI matlab..
thanks in advance
  댓글 수: 1
Jan
Jan 2011년 3월 24일
What does "show the time" mean? Do you want tick marks in a plot, strings in the command window or in a file, text in a GUI as UICONTROL or TEXT object? Which format have the data containing these nano-seconds?
Please be much mire specific. We cannot guess all these important details.

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

답변 (1개)

Walter Roberson
Walter Roberson 2011년 3월 24일
Please read this earlier discussion first to see why you cannot get meaningful nanosecond times from Matlab.
But if you really want to display the time in nanoseconds, then use datevec() to convert the time to a vector of components, extract the last one (the seconds), multiply the seconds by 10^9, and convert that to a string by your favorite method such as str2num() or sprintf().
Don't forget to display the fractions of a nanosecond; you only need to allocate enough space for 755 positions after the '.' .
sprintf('%.755g',eps(realmin))

카테고리

Help CenterFile Exchange에서 Migrate GUIDE Apps에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by