Where do i add a loadlibrary command in a class definition?

Hi,
i want to write a Matlab class file which implemtens functions provided by a library. This library contains functions which enable Matlab to read simulation results without the need to open the simulation software. So i want to create objects which contain the simulation results. My question is: Is it possible or does it even make sense to load the library in the class defintion? Where in the class defintion do i load the library?
Thanks for your help.

댓글 수: 3

Not sure if I understand your question correctly, but shouldn't you load the library in the method where you are calling into it? Or did you want to load it in the class constructor, unload it in the class destructor; and assume that it is loaded in all methods?
I am not sure either that I fully understand .. do you want to "pass the library dynamically" to some method of objects instantiated from your new class so they can each use a different library?
@Kaustubha Govind: You gave me a hint in the right direction I think. I didn't consider to load the library in the class contructor. Due to time issues I have to delay this project for a few weeks. At the moment I'm using a simple skript to load the library and access the simulation results.

댓글을 달려면 로그인하십시오.

답변 (2개)

David Sanchez
David Sanchez 2013년 5월 13일

0 개 추천

댓글 수: 1

Right, I'm following an OOP approach. The question is, where to load the library, which contains the functions I want to use for in my methods?

댓글을 달려면 로그인하십시오.

David Sanchez
David Sanchez 2013년 5월 13일

0 개 추천

You do not have to load your libraries, your functions have to be saved as .m files in the working directory. Matlab looks for them automatically.

카테고리

제품

질문:

2013년 5월 13일

Community Treasure Hunt

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

Start Hunting!

Translated by