function output_txt = myupdatefcn(obj,event_obj)
% Display the position of the data cursor
% obj          Currently not used (empty)
% event_obj    Handle to event object
% output_txt   Data cursor text string (string or cell array of strings).
    old_data=guidata(obj);
    pos = get(event_obj,'Position');
    [~,col]=find(old_data==(pos(2)));
    
    output_txt = {['X: ',num2str(pos(1),4)],...
        ['Y: ',num2str(pos(2),4)],...
        ['Increment level: ',num2str(col)]};
    
    % If there is a Z-coordinate in the position, display it as well
    if length(pos) > 2
        output_txt{end+1} = ['Z: ',num2str(pos(3),4)];
    end
end