How do I remove a code mapping from a model?

10 views (last 30 days)
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.

Answers (1)

Rishav
Rishav on 3 May 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 Comment
Scott Tatum
Scott Tatum on 5 May 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.

Sign in to comment.

Categories

Find more on Deployment, Integration, and Supported Hardware in Help Center and File Exchange

Products


Release

R2022b

Community Treasure Hunt

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

Start Hunting!