function MapContain = MapMake(Det, Inten, TimeLength, Tdur, NutValOri)


% Det: 0: no fluctuation (constant as NutValOri), 1: fluctuating
% Tdur: duration of a nutrient map


[rmap, cmap] = size(NutValOri);


MapTS = ceil(TimeLength/Tdur) + 1;

MapContain = cell(MapTS,1);

if Det==0

    for Mts = 1:MapTS

        MapContain{Mts} = NutValOri;

    end

elseif Det == 1

    for Mts = 1:MapTS

        NtMap0 = rand(20,20);
        pzero = 0.5;
        NtMap0(NtMap0 < pzero) = 0;
        NtMapRS = imresize(NtMap0, [max(rmap, cmap), max(rmap, cmap)], 'method', 'triangle');
        NtMapDF = imgaussfilt(NtMapRS, 10);

        NtMapDF = Inten*NtMapDF(1:rmap, 1:cmap);

        MapContain{Mts} = NtMapDF;

    end

end

% 
% for TS = 1:(Mts*Tdur - 1)
% 
%     TargetNum = floor(TS/Tdur) + 1;
%     TargetMap = MapContain{TargetNum};
% 
% Cmap = (1- 0.05)*Cmap + 0.05*TargetMap;
% 
% imagesc(Cmap)
% colormap pink
% pause
% 
% 
% 
% 
% 
% end
% 
% 
% 
% 
% 
% imagesc(NtMapDF)
% colormap pink
% clim([0 1])