How to get system date and time into simulink?
이전 댓글 표시
Is there a way to get the system date and time (not simulation time) into simulink?
댓글 수: 2
TAB
2012년 2월 28일
In which datatype & formate?
How you are going to use it in simulink?
Jan De Vries
2012년 2월 28일
채택된 답변
추가 답변 (4개)
Rick Rosson
2012년 2월 28일
A slightly simpler version:
function [Y, M, D, H, MN, S] = sysClock()
coder.extrinsic('clock');
Y = 0;
M = 0;
D = 0;
H = 0;
MN = 0;
S = 0;
[Y, M, D, H, MN, S] = clock;
end
댓글 수: 1
macs macalintal
2016년 3월 1일
it says error, too many output arguments, help pls
Rick Rosson
2012년 2월 28일
댓글 수: 5
Jan De Vries
2012년 2월 28일
TAB
2012년 2월 28일
Try.........
function t = sysTime
eml.extrinsic('now');
t=0;
t = now;
end
Note:
'now' returns the current date and time as a serial date number.
Rick Rosson
2012년 2월 28일
Sorry, I forgot to include the extrinsic declaration. Thanks, TAB.
macs macalintal
2016년 3월 7일
how to call the current time only, not with the current date?
Walter Roberson
2016년 3월 7일
There is no way to fetch only the time without the date. The sysClock routine that Rick showed above can be modified to discard the date portions and return only the time components.
Kareem Abdelgawad
2014년 11월 24일
0 개 추천
I tried to use it under 'Real-Time Windows Target', but it doesn't work. Any ideas how to read system time under 'Real-Time Windows Target'?
카테고리
도움말 센터 및 File Exchange에서 Deployment, Integration, and Supported Hardware에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!