function q = generate(n,m,g)

p = int8((n-m)/2);
p = double(p);
q = zeros(n,n);
for i=1:p
   q(:,i) = 50;
end
for i=(p+1):(p+m)
   q(:,i) = 50+(i-p)*g; 
end
    
for i=(p+m+1):n
   q(:,i) = 50+(m+1)*g; 
end

q = uint8(q);

