How do I access a subclass from a abstract Superclass.

1 view (last 30 days)
Hello everybody,
I am new to Matlab, but quite familar with C++.
I want to control some function generators using Matlab. Every function generator needs the same functions like setFrequency() or setPower(), but how they are implemented depends on the type of the function generator I am using. When doing measurements I don't want to know, what kind of function generator I am using, but just use the mentioned functions.
In C++ I would have created a abstract baseclass for all function genrators with the methods I need as abstract (virtual) methods. Then I would created subclasses for every functiongenerator to implement the abstract functions.
That seems to work with matlab in a quite similar way. But is there a possibility to access those function if I know only about the abstract superclass?
In C++ I would have created a pointer on the superclass wich points to a object of the signal generator I am using. So every function that has do communicate with the signal generator need as the argument only a pointer to a signal generator and don't need to know what type of signal generator I am actually using.
Is there a way, to do this in matlab? I found something about abstract interface classes and handle classes, but nothing seemed to be exactly what I was looking for.
I hope someone can help me.
Tilman

Answers (0)

Categories

Find more on C Shared Library Integration in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!