Quantcast
Channel: MATLAB Central Newsreader Recent Posts
Viewing all articles
Browse latest Browse all 19628

Converter method results in syntax error

$
0
0
Hi,

I'm trying to write a converter method for my custom class to another class which is inside a sub-package. This results into the following piece of code:

classdef Mode

  enumeration
    ...
  end

  function obj = analysis.position.Mode(this)
     ...
  end

end

Matlab actually tells me that "analysis.position is not Static, so it must have at least one input argument". I do not understand this error as "analysis.position.Mode" is a class within a sub-package. It looks to me as Matlab simply does not support sub-package notation for converter methods since moving the class into a simple package resolves the problem.

I have many converter methods that uses classes that are part of subpackages and the help for converter methods only says that the converter method should have the name of the class.

Is there a special notation for that?
Is that a bug in the matlab parser?

Thanks in advance for any help.

Viewing all articles
Browse latest Browse all 19628

Trending Articles