I have the following code that I need to run over a matrix with over 20000 rows. It takes several minutes to run and the datenum and str2double functions appear to be the bottlenecks. Since no calculation depends on previous ones is there a way to break the loop into multiple parts and have them execute in parallel? Any advice on optimising this code would be appreciated.
for i=1:length(DJI) DJI2(i,1)=datenum(char(DJI(i,2)),'yyyy-mm-dd'); for j=3:7 DJI2(i,j-1)=str2double(char(DJI(i,j))); end end