r_values=-4:0.001:4;
iterations_per_value=100;
output_matrix=zeros(iterations_per_value,length(r_values));
for count=1:length(r_values)
    r=r_values(count);
    y=.5;
    for i=1:iterations_per_value
        y=r*(y*(1-y));
    end
    for i=1:iterations_per_value
        y=r*(y*(1-y));
        output_matrix(i,count)=y;
    end
    
end
plot(r_values,output_matrix,'.');
grid on;
