Here is my update on the solution I have reached. The following code does what is explained in the question:
clear; clc;
%%Real Variables
L1 = 0.2:0.05:0.9;
L2 = 0.2:0.05:0.9;
%%GA Variables
ObjectiveFunction = @simple_fitness;
nvars = 2; % Number of variables
LB = [1 1]; % Lower bound
UB = [15 15]; % Upper bound
IntCon = [1,2]; % Both Variables are Integers
%%Run GA
opts = optimset('PlotFcn',{@gaplotbestf,@gaplotbestindiv,@gaplotselection});
opts.PopulationSize = 5;
opts.EliteCount = 1;
%opts.MaxGenerations = 20;
[x,fval,exitFlag,Output] = ga(ObjectiveFunction,nvars,[],[],[],[],LB,UB,[],IntCon,opts);
%%GA Outputs
fprintf('The number of generations was : %d\n', Output.generations);
fprintf('The number of function evaluations was : %d\n', Output.funccount);
fprintf('The best function value found was : %g\n', fval);
%%Disply Outputs
disp(' ')
disp('Position of Slot #1 =')
disp(L1(x(1)))
disp('Position of Slot #2 =')
disp(L1(x(2)))
disp('Ct =')
disp(0.083036369/fval)
Here is how I defined the fitness function to read the Ct value from the excel sheet:
function y = simple_fitness(x)
Ct = xlsread('CtVsPitch.xlsx');
y = 0.083036369 / Ct(x(1),x(2));