1

I have a class redefining the default subscript assignment (subsasgn). Since it is a wrapper around memmapfile, I do not need the return value of subsasgn, so how do I ignore it?

Linked to this question, but trying to ignore all returned arguments :

dummy = subsasgn(self.mmap.Data.bit, newSub, value);
Hugo Trentesaux
  • 1,584
  • 1
  • 16
  • 30

1 Answers1

5

This will be detected as "output requested" but not stored.

[~] = subsasgn(self.mmap.Data.bit, newSub, value);

However, this is for the case when something internal of subsasgn will not compute in the case that outputs are not requested (coded with some nargout check). For a general function where this does not happen you can just do:

subsasgn(self.mmap.Data.bit, newSub, value);

As I do not have the source code I can not guess which one you need.

Ander Biguri
  • 35,140
  • 11
  • 74
  • 120