%FEEDBACKUPDATE - the output of the update function is a pair of 1x2 cell array
%with format [state, output]
function out = feedbackUpdate(state,in)
%initialize to a stuttering output
out = {state, 'absent'};
if ~strcmp(in, 'absent')
    switch(state)
        case 'happy'
            if strcmp(in, 'purrs')
                out = {'happy', 'time passes'};
            else
                out = {'hungry', 'time passes'};                
            end
        otherwise
            if strcmp(in, 'purrs')
                out = {'happy', 'feed'};
            else
                out = {'hungry', 'feed'};
            end
    end    
end
