function [predictedValue] = ruleInduction(testSet, trainSet) % generate a regression tree on the training data myTree = treefit(trainSet(:,1:(size(trainSet,2)-1)), trainSet(:,size(trainSet,2))); % evaluate the tree at the test instance and get the predicted value predictedValue = (testSet(1,1:(size(trainSet,2)-1))); end