reformulating for loop with vectorization or other approach - octave
问题 Is there any way to vectorize (or reformulate) each body of the loop in this code: col=load('col-deau'); %load data h=col(:,8); % corresponding water column dates=col(:,3); % and its dates %removing out-of-bound data days=days(h~=9999.000); h=h(h~=9999.000); dates=sort(dates(h~=9999.000)); [k,hcat]=hist(h,nbin); %making classes (k) and boundaries of classes (hcat) of water column automatically dcat=1:15; % make boundaries for dates for k=1:length(dcat)-1 % Loop for each date class ii=find