How to load a library in main but call it in a function ?

3 ビュー (過去 30 日間)
Andrew Juenger
Andrew Juenger 2011 年 4 月 18 日
Hi, I want to load a library in my main program, call it several times from within a Matlab function called by the main, and then unload it from the main. My problem now is that my function does not "see" the loaded library. How can I do this, alias, global? Thanks

採用された回答

Chirag Gupta
Chirag Gupta 2011 年 4 月 18 日
Hi Andrew,
I was able to do the same with a simple example:
function testMain()
% Load a library
loadlibrary('shrlibsample','shrlibsample.h','alias','lib');
libfunctions lib
mySub()
unloadlibrary('lib');
% Another function
function mySub
str ='hello World';
calllib('lib', 'stringToUpper', str)
  1 件のコメント
Andrew Juenger
Andrew Juenger 2011 年 4 月 18 日
It worked, thank you very much.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMATLAB についてさらに検索

タグ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by