I'm able to draw a plot for out with size 100x11 using below code
x=0:0.1:1; plot(x, out(:,(x*10)+1),'ko');
But I'm unable to figure out how to draw jitter plot for that data.
Below is my complete Matlab code that I'm using to save data into the output variable and trying to plot the data of output using jitter plot.
clc;
close all;
clear all;
heads = 0;
flip_chance = 0.0;
weight = 0.0;
c = 2;
output = zeros(100,11);
for p = 0.1:0.1:1.0
for i = 1:1:100
heads = 0;
flip_chance = 0.0;
for j = 1:1:10
weight = rand();
flip_chance = (p*10)+weight;
if flip_chance >= 0.5 && weight <= p
heads = heads + 1;
end
end
%fprintf ("p : %f , heads : %d\n ", c, heads);
output(i, c) = heads;
end
c = c+1;
end
x=0:0.1:1;
plot(x, output(:,(x*10)+1),'ko');
When I run with the plot I'm getting below output
I trying to get the plot in the below format