Amos Kang
Amos Kang

Reputation: 534

Calling .NET superclass method in Matlab

stackers,

Right now I am facing up one issue which concerned on calling .NET methods in Matlab. The relative reference can be found through link below:

[http://www.mathworks.com/help/techdoc/matlab_external/brpb5k6.html][1]

My issue is that when I get the object from .net, I want to call its superclass's method. So it means that I want to cast the type to its super parent's type.

Image that I got objectA from .net calling in matlab, the class of objectA is the child of objectB, my intention should be like the below line of code:

objectB = cast(objectA, 'parent class type')

It does not work, any helps or comments on it?

Thanks

Upvotes: 0

Views: 394

Answers (1)

Ben Voigt
Ben Voigt

Reputation: 283893

Methods in the parent (superclass or base) type are inherited, and can be called on an object of the subtype.

Or are you trying to call the base class version of a virtual method? You cannot do that from outside the class.

Upvotes: 1

Related Questions