フィルターのクリア

take time from user !

4 ビュー (過去 30 日間)
Khaled Al-Faleh
Khaled Al-Faleh 2017 年 4 月 28 日
回答済み: Image Analyst 2017 年 4 月 29 日
Hi I have a gate and I want to take the time in and out from user but the problem in my program is saved as string see this
%========= TIME IN==========%
prompt = {'Enter Time In:'};
dlg_title = 'TIME IN';
num_lines = 1;
defaultans = {'0'};
TimeIn = inputdlg(prompt,dlg_title,num_lines,defaultans);
%========= TIME OUT=========%
prompt = {'Enter TIME OUT:'};
dlg_title = 'Time out';
num_lines = 1;
defaultans = {'0'};
TimeOut = inputdlg(prompt,dlg_title,num_lines,defaultans);
the problem here its store it as string and if the user enter let say 10:15 and out 10:50 how H can make sure that the interval between them is unavailable..

採用された回答

Image Analyst
Image Analyst 2017 年 4 月 29 日
Parse out the numbers, like with strtok(), then pass the numbers into etime(). Or use newer functions like datetime().

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeDates and Time についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by