フィルターのクリア

emlc generates two different c-files for the same supporting function when building two functions, how do you merge them?

1 回表示 (過去 30 日間)
If I have two functions:
function y = fcn1 %#eml
A = [
8 1
3 5
4 9
];
y = pinv(A);
and
function y = fcn2 %#eml
A = [
1
4
];
y = pinv(A);
and build them
% build functions
emlc -c -T rtw:lib -report -d fcn1 fcn1.m
emlc -c -T rtw:lib -report -d fcn2 fcn2.m
I get two versions of svd.c. What is the best way to merge the resulting object files? I want to call these functions from the same code.

採用された回答

Fred Smith
Fred Smith 2011 年 8 月 22 日
Hi Todd,
Just use this idiom emlc -c -T rtw:lib -report -d foo1 fcn1 fcn2
That will product a library with an entry point for fcn1 and fcn2 that shares all the common code like SVD used by both of them.
-Fred
  1 件のコメント
Todd
Todd 2011 年 8 月 22 日
Thanks, this works. (I should have looked more closely at the help file...) I get an error when it tries to compile the report, but the library builds and works as expected.

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

その他の回答 (1 件)

Todd
Todd 2011 年 8 月 19 日
I suppose I could build a library (.lib) for each function. Then I would have redundant object code, but at least I would have them all. Can I assume that generated supporting functions with the same name are functionally the same?

カテゴリ

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

タグ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by