dot_color = repmat([1 0 0], length(Lock), 1);
dot_color(Lock == 3, :) = [0 0 1];
lat = y; long = x;
pointsize = 20;
scatterm(lat, long, pointsize, dot_color)
or
cmap = [1 0 0; 0 0 0; 0 0 0; 0 0 1];
lat = y; long = x;
pointsize = 20;
scatterm(lat, long, pointsize, cmap(Lock+1,:));