This could be made a bit cleaner (and more efficient with a containers.Map object. The relevant code would look like:

```
disabled_msgids = containers.Map();

...

function warnOnce(obj, msgid, varargin)
  if ~isKey(obj.disabled_msgids, msgid)
    warning(msgid, varargin{:});
    obj.disabled_msgids(msgid) = true;
  end
end