function [predictedValue] = CARTOff(testSet, trainSet)

% generate a regression tree on the training data
myTree = treefit(trainSet(:,1:(size(trainSet,2)-1)), trainSet(:,size(trainSet,2)),'prune','off');

% evaluate the tree at the test instance and get the predicted value
predictedValue = myTree(testSet(1,1:(size(trainSet,2)-1)));

end