is it o.k if 'tic' is in one function and 'toc' is in another?
4 次查看(过去 30 天)
显示 更早的评论
is it o.k if 'tic' is in one function and 'toc' is in another? I am working with a gui and I want to set tic in one place and toc in a different function, possible?
0 个评论
采纳的回答
Matt Fig
2012-10-15
编辑:Matt Fig
2012-10-15
Yes, tic is global. Here is an example I made to test....
Example. 1st M-file:
function [] = calltic()
tic;
Second, separate M-file:
function [T] = calltoc()
T = toc;
From the command line:
>> calltic,calltoc
ans =
1.1999e-004
>> calltic,pause(.998),calltoc
ans =
1.0001
0 个评论
更多回答(1 个)
Image Analyst
2012-10-15
Wouldn't it be easy enough to try? Then you'd find out, probably quicker than asking here.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Environment and Settings 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!