Why do I get the error: Unable to resolve the name 'coder.api​.internal.​getFunctio​nDefaults'​?

Every time I run my simulink model and then make a change to the model (e.g. change a constant value or move a line) and try to save, this error appears.

Respuestas (1)

Hi Theresa,
The error "Unable to resolve the name 'coder.api.internal.getFunctionDefaults'" in Simulink typically occurs when you are trying to save a Simulink model with a custom block that uses the code generation API, but the required coder library is not available. This can happen if you are using an older version of MATLAB that does not include the necessary libraries, or if the library has been manually removed from your installation.
To resolve this issue, try updating to the latest version of MATLAB and make sure that all necessary libraries and toolboxes are installed. If you still encounter the error, you may need to manually add the missing library by following these steps:
  1. In MATLAB, go to the Home tab and click on Add-Ons.
  2. Select Get Hardware Support Packages.
  3. Search for the "MATLAB Coder" toolbox and install it if it's not already installed.
  4. After installation, restart MATLAB and try saving your Simulink model again.
If you still encounter the error after following these steps, it's possible that the issue is with the custom block in your Simulink model. Then you need to check your custom block.

5 comentarios

What if the user does not have the Matlab / Simulink / Embeded Coder license(s)? IE if a model is shared, but only one user has the code generation license.
Then that would count as the coder library not being available.
@Walter Roberson I understand that. The baseline Simulink simulation should not have any impact due to the coder configurations. And it runs fine to start with, but if you try to modify after a run there is an error.
All it would take to run into this kind of problem would be for there to be a hook into the code generation library code along the lines of "Hey, we're saving the file now, did you want to do anything?". And even if the normal answer is, "Thanks, we're good", that would still be an invocation of the library.
I have seen this too and ignored it because I did not need to generate code. However I would like to be able to find the block that is causing the message and modify it. How would I find that?

Iniciar sesión para comentar.

Categorías

Más información sobre Simulink Coder en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 10 de Feb. de 2023

Comentada:

el 9 de Jul. de 2024

Community Treasure Hunt

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

Start Hunting!

Translated by