How do I remove a code mapping from a model?

7 visualizaciones (últimos 30 días)
Scott Tatum
Scott Tatum el 14 de Mzo. de 2023
Comentada: Scott Tatum el 5 de Mayo de 2023
I used the code mapping editor and api to add code mappings to several models. This appears to have caused issues with other members of the team that do not have the embeded coder toolbox (see this question). I would like to set it up where I configure the code mappings later, as part of the code generation process, instead of just having it on all the time. But I cannot figure out how to remove code mappings from a model that has them. Nothing in the GUI shows how to do it, and the code.mapping command line path has no remove functions.

Respuestas (1)

Rishav
Rishav el 3 de Mayo de 2023
Hi Scott,
To remove code mappings from a model, you can follow these steps:
  1. Open the model in MATLAB.
  2. In the MATLAB command window, type coder.mapping.api.get(model) to get the current code mappings for the model.
  3. Identify the code mappings that you want to remove and note their names.
  4. Type coder.mapping.api.remove(model, 'mapping_name') for each code mapping that you want to remove, replacing 'mapping_name' with the name of the code mapping you want to remove.
  5. Save the model.
This should remove the code mappings from the model. You can then configure the code mappings later, as part of the code generation process, by using the code mapping editor and API.
You can also refer to this documentation to know about more such functions related to code mapping: Model data and function interface configuration for C code generation - MATLAB (mathworks.com)
Regards,
Rishav Saha
  1 comentario
Scott Tatum
Scott Tatum el 5 de Mayo de 2023
Hi Rishav
It is unclear to me in 2 how I get the mapping names I want to remove. I would like the entirety of the mapping to be gone, not just any one part of it.
Also, I tried 4 and get this error
Unable to resolve the name 'coder.mapping.api.remove'
I would like to return the models to their "vanilla" state before a code mapping was ever crated.

Iniciar sesión para comentar.

Categorías

Más información sobre Deployment, Integration, and Supported Hardware en Help Center y File Exchange.

Productos


Versión

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by