# Created by Octave 4.4.1, Nov 15 2018 %LBpContour -- Copyright Giovanni Ciriani %Produces the contour of Lawn Bowling probabilities between 2 players given the distance parameter % distances are Poisson or Gamma distribution, other distributions may be used as well %% Initialization % clear ; close all; clc %input parameters printf('Running Lawn Bowling prob Contour... '); [X,Y] = meshgrid(100:20:1000,100:20:1000);%Distance mesh grid ends = 100 c = size(X,2);%columns r = size(Y,1);%rows tic for i = 1:size(X(:),1)%cycle through grid prob(i) = LawnBowlingFunctG(X(i), Y(i), ends); end %stop timing toc Z = reshape(prob,r,c); figure(1) contour(X, Y, Z, 'ShowText','on', [0.5 0.6 0.7 0.8 0.9]) figure(2) surf(X,Y,Z)