how to speed up the process

2 次查看(过去 30 天)
Pat
Pat 2011-12-29
my dataset is aroud 32000rows and 6 columns
my program link
it takes 24 hrs to run,please help how to speed up the process

回答(1 个)

Jan
Jan 2011-12-29
At first search for the most time consuming part of the function using the PROFILEr. It would be useless to optimize a part, which takes 0.1% of the processing time.
Then examine the found "bottleneck" and check for a proper pre-allocation, the possibility to use integer types instead of doubles, simplify the contents of loops and avoid all repeated calculations. Finally check if a vectorization could be possible.
Does the algorithm exhaust your RAM? Then installing enough memory can give a speed-up of factor 1000.
Can the problem be parallelized? Then PARFOR might be helpful.
After or before the above steps have been performed, buy a computer with the double speed. Then the computation will take 50% of the time.
  4 个评论
Jan
Jan 2011-12-29
The "echo" command will show the currently processed line. See "help echo". Take into account, that this will slow down the processing dramatically.
Instead of this brute display of every line, you could use "waitbar" or some "disp" statements to show the progess.
Pat
Pat 2011-12-30
OriginalData=xlsread('dataset.xls');
[r c]=size(OriginalData)
k=zeros(r,1);
OriginalData=[OriginalData k];
[ DiscretData,DiscretizationSet1 ] = CACC_Discretization( OriginalData,1);
DiscretizationSet1
this is my program can u please tell where to use those commands to see which line is ececuting

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Loops and Conditional Statements 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by