How to use the .p file for simulation and generation code

9 ビュー (過去 30 日間)
Chuyen
Chuyen 2023 年 4 月 3 日
回答済み: Rik 2023 年 4 月 4 日
This is my .m file, and I am using it for an Matlab funtion block. Now I want to use it as .p script and converted it from .m script to .p script and changed the name into AdapRatFunc_pfile
function [Intl,ratIntl] = Adap(X_a,X)
%#codegen
[Intl,ratIntl] = AdapRatFunc(X_a,X);
However, when I replaced AdapRatFunc by AdapRatFunc_pfile file, there is an error about it: "Undefined function or variable AdapRatFunc_pfile".
How can I fix it?
Thank you

回答 (1 件)

Rik
Rik 2023 年 4 月 4 日
Matlab functions are called by name, so if you change the name you need to change the call as well. The best way would be to change the name prior to converting to p-code.

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by