Clear Filters
Clear Filters

Echo out Simulink Coder environmental variables

2 views (last 30 days)
is there a way to echo out Environmental variables used by Simulink Coder?
For example, the linker file for the Simulink Embedded Coder Hardware Support package is addressed by default by:
which evaluates in the end to:
Is there a way how I could get this path in Matlab? I'd like to write a script that moves a file to that specific location, and for that I'd need the target path.
Alternatively, are there other environmental variables like $(TARGET_ROOT) available?
Thanks in advance!

Answers (1)

Gyan Vaibhav
Gyan Vaibhav on 28 Feb 2024
Hi Michael,
For accessing environment variables in MATLAB you can use the "getenv" function as follows:
This gives you the values of the environment variables that MATLAB and Simulink uses to specify various attributes and properties.
targetRoot = getenv('TARGET_ROOT');
Find more information about this on the following documentation page:

Community Treasure Hunt

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

Start Hunting!