error: Undefined function 'secs2hms' for input arguments of type 'double'.

조회 수: 1 (최근 30일)
I want to show my total sample time (H:M:S) in an edit box in Matlab GUI. Here is my code:
samplingrate=200;
totalmtime_sec=length(result)/samplingrate;
format short; % because totalmtime_sec = 3.000e+3 -> may give error?
makinginteger= round(totalmtime_sec);
makinginteger
totalmtime = secs2hms(makinginteger);
set(handles.edit6,'string' , totalmtime);
Although the variable "makinginteger" is 3000, I get this error:
>>makinginteger =
3000
Undefined function 'secs2hms' for
input arguments of type 'double'.
Can anybody fix it? Thanks in advance!
  댓글 수: 4
Ekin
Ekin 2013년 9월 2일
And here is the example i exactly took:
>> secs2hms(7261)
Undefined function 'secs2hms' for
input arguments of type 'double'.
what is the problem with my matlab? :/
Ekin
Ekin 2013년 9월 2일
Tried creating a "secs2hms" function in current directory but still same error..

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

채택된 답변

Ekin
Ekin 2013년 9월 2일
Ok, solved it. Changed directory to elsewhere and changed directory back where i created the function. Bug or glitch maybe?

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Dates and Time에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by