Dear Vahid,
You can use hurst exponent/ detrended fluctuation analysis to calculate which IMFs to keep and which to discard. The code for the same can be found here.
http://www.mathworks.com/matlabcentral/fileexchange/52502-denoising-signals-using-empirical-mode-decomposition-and-hurst-analysis
Best wishes