example = mat2cell(rand(100000,4),ones(1,100)*1000,4);result = cell( size(example, 1), 1);var1_list = [0.5, 0.7];var2_list = [0.3, 0.5, 0.7];final = cell( length(var1_list)*length(var2_list), 1);cnt = 1;for var1 = var1_list for var2 = var2_list for i = 1 : size(example, 1) index1 = find( (example{i, 1}(:, 2) >= var1 )==1); index2 = find( (example{i, 1}(:, 3) >= var2 )==1); index = intersect(index1, index2); if ~isempty(index) result{i, 1} = index; end end final{cnt, 1} = result; cnt = cnt + 1; endend
How can i do it fast way ? or How can i convert to gpuarray?
Best Answer