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

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 件のコメント

Azzi Abdelmalek
Azzi Abdelmalek 2013 年 9 月 1 日
If y=200, what are you expecting as result?
Ekin
Ekin 2013 年 9 月 1 日
i checked examples for secs2hms function, when you input an integer it gives you hours, minutes and seconds in string; the problem is i am giving 3000 as an input to this function but it doesn't accept it.?
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 日

0 投票

Ok, solved it. Changed directory to elsewhere and changed directory back where i created the function. Bug or glitch maybe?

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeDates and Time についてさらに検索

質問済み:

2013 年 9 月 1 日

Community Treasure Hunt

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

Start Hunting!

Translated by