% MATLAB lasso introduce http://www.mathworks.com/help/stats/lasso.html clear tic %start to compute time % xlsread uses excel file(xls or xlsx) ; The sheet of using file rename 'sheet1' % command "..." :connect between code and code. % command ":" :output from the specify matrix %test sample for X dimension:CTR_fold2 x = xlsread('fold1.csv','fold1','A2:Y1000'); % sheet1 is a worktable(Left-Down). %test sample for Y dimension:CTR_fold2 y = xlsread('fold1.csv','fold1','Z2:Z1000'); % start lasso [B FitInfo] = lasso(x,y,'CV',5); lam = FitInfo.Index1SE; result = B(:,lam); toc % end of computing time