%% This file provides the FORMAT you should use for the
%% slopes in HP2.3. x denotes the horizontal distance
%% travelled (by the truck) on a given slope, and
%% alpha measures the slope angle at distance x
%%
%% iSlope denotes the slope index (i.e. 1,2,..10 for the
%% training set etc.)
%% iDataSet determines whether the slope under consideration
%% belongs to the training set (iDataSet = 1), validation
%% set (iDataSet = 2) or the test set (iDataSet = 3).
%%
%% Note that the slopes given below are just EXAMPLES.
%% Please feel free to implement your own slopes below,
%% as long as they fulfil the criteria given in HP2.3.
%%
%% You may remove the comments above and below, as they
%% (or at least some of them) violate the coding standard
%% a bit. :)
%% The comments have been added as a clarification of the
%% problem that should be solved!).
function alpha = GetSlopeAngle(x, iSlope, iDataSet)
if (iDataSet == 1) % Training
if (iSlope == 1)
alpha = 4 + sin(x/100) + cos(sqrt(2)*x/50); % You may modify this!
%%
%% Insert the remaining 8 training set slopes here
%%
elseif (iSlope== 10)
alpha = 3 + 2*sin(x/50) + cos(sqrt(2)*x/100); % You may modify this!
end
elseif (iDataSet == 2) % Validation
if (iSlope == 1)
alpha = 6 - sin(x/100) + cos(sqrt(3)*x/50); % You may modify this!
%%
%% Insert the remaining 3 validation set slopes here
%%
elseif (iSlope == 5)
alpha = 5 + sin(x/50) + cos(sqrt(5)*x/50); % You may modify this!
end
elseif (iDataSet == 3) % Test
if (iSlope == 1)
alpha = 6 - sin(x/100) - cos(sqrt(7)*x/50); % You may modify this!
%%
%% Insert the remaining 3 test set slopes here
%%
elseif (iSlope == 5)
alpha = 4 + (x/1000) + sin(x/70) + cos(sqrt(7)*x/100); % You may modify this!
end
end