tic, s=0; for i=1:100000, s=s+1/2^i+1/3^i; end; toc 这样的一个语句,为什么每次的到的结果不同 Elapsed time is 0.189000 seconds. Elapsed time is 0.210000 seconds. Elapsed time is 0.196000 seconds. Elapsed time is 0.203000 seconds. Elaps... tic, s=0; for i=1:100000, s=s+1/2^i+1/3^i; end; toc
这样的一个语句,为什么每次的到的结果不同
Elapsed time is 0.189000 seconds.
Elapsed time is 0.210000 seconds.
Elapsed time is 0.196000 seconds.
Elapsed time is 0.203000 seconds.
Elapsed time is 0.197000 seconds.
Elapsed time is 0.205000 seconds.
Elapsed time is 0.199000 seconds.
Elapsed time is 0.199000 seconds.
Elapsed time is 0.189000 seconds.
tic表示开始计时
toc表示计时结束
这两个语句是计算仿真消耗的时间