日日行,不怕千万里;时时学,不怕千万卷
分类:
2008-01-01 21:36:39
clear all clc tic for a=0:1:10000 b(a+1)=a^2-a+1; end toc |
Elapsed time is 0.244107 seconds. >> |
clear all clc tic b(1:10001)=0; for a=0:1:10000 b(a+1)=a^2-a+1; end toc |
Elapsed time is 0.000459 seconds. >> |
clear all clc tic a=0:1:10000; b=a.^2-a+1; toc |
Elapsed time is 0.000311 seconds. >> |