필터 지우기
필터 지우기

Want to add second to a time stamp

조회 수: 2 (최근 30일)
Md
Md 2015년 11월 10일
댓글: dpb 2015년 11월 10일
Hi I want to add a time value in second to a time stamp. for example: 10:12:49+ 526 second what will be the output in hr:mm:ss
Thank you.

채택된 답변

dpb
dpb 2015년 11월 10일
"Classic" date numbers...
>> datestr(addtodate(datenum('10:12:49','HH:MM:SS'),526,'second'),'HH:MM:SS')
ans =
10:21:35
>>
There's a new date/time class w/ built in methods if have later version to do same thing.
  댓글 수: 2
Md
Md 2015년 11월 10일
Thank you very much. Can you please help me with one more problem: I have a matrix with "second". Want to add them with the datenum and want to see the output in a file.
dpb
dpb 2015년 11월 10일
All the above functions are fully vectorized per Matlab general rules; simply replace the constants above with the appropriate variable(s).
After that, writing the output to a file is covered in the "Getting Started" documentation under "Data Import and Export" under the Section "Data and File Management"

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Convert Image Type에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by