Curve fitting with compiler.b​uild.stand​aloneAppli​cation

조회 수: 39 (최근 30일)
Marius
Marius 2024년 11월 4일 9:35
답변: Jaimin 2024년 11월 5일 10:02
This is probably simple question but i do not get what is happening
i do compile my code using
compiler.build.standaloneApplication('my_code.m')
code is extreamly simple
load census;
f = fit(cdate,pop,'poly3','Normalize','on','Robust','Bisquare')
when i try to run it on machine that has matlab compiler runtime i'm getting
Unrecognized function or variable 'fit'
MATLAB:UndefinedFunction
Was under impression that toolbox Curve Fitting is supported and should be included.
  댓글 수: 1
Walter Roberson
Walter Roberson 2024년 11월 4일 10:51
이동: Walter Roberson 2024년 11월 4일 10:51

Experiment with adding

%#function fit

to the code

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

채택된 답변

Jaimin
Jaimin 2024년 11월 5일 10:02
To verify if the "Curve Fitting Toolbox" is installed and recognized by MATLAB, enter the "ver" command in the MATLAB application's command window. The "ver" command will display the version of MATLAB you are using, your license number, and the list of installed toolboxes.
If the "Curve Fitting Toolbox" is not installed, please install it. If it still doesn't work after installation, update the function call by adding %#function fit.
The “%#function” pragma in MATLAB is a directive used to inform the MATLAB compiler about functions that are called dynamically (i.e., using eval, feval, or similar functions). This is particularly useful when deploying MATLAB applications, as it ensures that the specified functions are included in the compiled application.
Additionally, I suggest loading the "census" data using its absolute path.
For more information, refer to the following MathWorks documentation
I hope this will be helpful.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Introduction to Installation and Licensing에 대해 자세히 알아보기

태그

제품


릴리스

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by