coder.extrinsic
10 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
ECE09 ITBHU
am 6 Aug. 2011
Kommentiert: Walter Roberson
am 15 Mär. 2018
every time i try to convert some matlab file using any pre-defined functions in between i am instructed by code generation report error of matlab coder 2.0 @MATLAB Ra2011 that i should call function using "coder.extrinsic('function name')
is it necessary to call every time?
0 Kommentare
Akzeptierte Antwort
Kaustubha Govind
am 6 Aug. 2011
Yes, it is necessary to declare functions unsupported for code generation using coder.extrinsic. See Calling MATLAB Functions in the MATLAB Coder documentation for further explanation. Note that you should not use extrinsic function calls if you are generating standalone C/C++ code. This is meant for generating MEX-functions from MATLAB code, where all extrinsic calls are actually dispatched to the MATLAB interpreter.
2 Kommentare
Emmanuel Luevano
am 5 Dez. 2012
hello, I have a doubt, If I declare an sub-function as extrinsic, I understand that embedded coder does not generate code for that, If the extrinsic function gives me a result that may vary according to the same input and it result is need for others blocks in simulink
how suppose the complete code will work in the processor if the code is not complete, as it did not generate the code for the extrinc function, it works so, or I'm getting consufe.
the other hand, I know that I should declare the type of variable in embedded editor from simulink before use it, when I declared a variable in a function, it name is exclusive just in that function or in all the file.
I hope you can clear up my doubts greetings, thanks
Kaustubha Govind
am 27 Dez. 2012
Variable names should be exclusive within their scope - for local variables, their scope is limited to the function, so unless their names clash with some global variables, you should be fine.
Did you mean to say that your code works correctly even though you generated standalone code from a function that calls extrinsic functions? Perhaps the default value specified for it's output is also the expected value of the function if it executed?
Weitere Antworten (1)
Selva Karna
am 15 Mär. 2018
Bearbeitet: Walter Roberson
am 15 Mär. 2018
Kaustubha Govind
i have get in error while almost use, coder.extrinsic('applycform');, its not support for code generation, how to solve this.
1 Kommentar
Walter Roberson
am 15 Mär. 2018
You posted a Question about this. I responded there; https://www.mathworks.com/matlabcentral/answers/388423-coder-extrinsic-applycform-not-support-for-code-generation-how-to-use-instead-of-applycform#answer_310139
Siehe auch
Kategorien
Mehr zu Simulink Coder finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!