Following lines of code shows one possible solution to your problem. The bar graph is created against a categorical value on the x-axis. In that case, heads and tails would be plotted as two variables.
x=categorical({'Heads and Tails'});
y=[heads,tails];
bar(x,y);
legend('Heads','Tails');