hello every one ...i need program for clock..or for e.g need code to write clock

my name is Masoud i study M.s mechanic engineer .i don't work for build clock but i use other code to Matlab... thank you for answer this question

11 commentaires

No..i need matlab code for clock..for example show me time date not show me for e.g like tic toc code..(you input m or n in to the matrix and build for loop and if after than when you run program show me time and date...you input first base time after than the loop beginning
Look on the file exchange.
@masoud: In the first part of the comment, you state, that you do not need the tic, toc behavior. Then you explain exactly the purpose of tic toc explicitly. Therefore I still do not understand what you want. Please post a small example what should appeare where. And please post this by editing the original question, not hidden in a list of comments. Thanks.
What does "i use other code to Matlab" mean? Do you mean that you have code that also doesn't work in some other language, such as C, Java, or Python? Do you want to write this in MATLAB or not?
@Masoud: I also not able to understand your exact requirement, but I guess you need code to display current time and date.
Try for this command in Matlab command window, if this can help you..--> java.util.Date()
you can use following code to split it and can store into separate var.
timeStr = char(java.util.Date());
day = timeStr(1:3);
month = timeStr(5:7);
date = timeStr(9:11);
time = timeStr(12:19);
timeZone = timeStr(21:23);
year = timeStr(25:28);
hi my friends thanks for answer my question..Well I need a clock program to answer a few questions on the Thesis ...
my teacher say to me..if you write with Mathematica it's easier than ..but i don't write Mathematica ..i write only Matlab.. so i will program code for show me time and date with for and loop
for e.g
for [i=1,i=24
for [j=1,j=60
for [k=1,k=(computer speed to solve loop e.g 10000)
]
s=s+1
]
m=m+1
]
h=h+1
seems like that up.. i think you know what i need...?
@Shameer Parmar @Image Analyst @Jan Simon@John D'Errico @Walter Roberson
i looking forward to ,,, the net but i don't find anything thank you. ( masoudmansouri8@gmail.com)
So what is this clock program supposed to do?
you put base information for E.g now the clock is 3.00 you start this time after than when you run code show me clock...use if and for
We don't know what you want. Specifically, you said you searched the File Exchange like John suggested but found nothing. But when I search it ( http://www.mathworks.com/matlabcentral/fileexchange/?utf8=%E2%9C%93&term=clock It brought up lots of clocks. Why don't any of them work? What about Thorsten's answer below, or Jan or Shameer's comments above using simple date and time strings and functions built into MATLAB? What's wrong with them?
@image analyst ...thank you yes...i wrong page open ...sorry..yes i find ...thanks....i now open and find them....thanks a very lot

Connectez-vous pour commenter.

Plus de réponses (1)

Thorsten
Thorsten le 2 Déc 2015
Modifié(e) : Thorsten le 2 Déc 2015
To show the current date and time, use
datestr(now)
If you want to measure the time, you can use tic; toc or clock and etime, as explained in
help etime

Catégories

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by