How to specify relative search path in S-Function builder APP?

14 ビュー (過去 30 日間)
Yingao Zhang
Yingao Zhang 2021 年 10 月 20 日
編集済み: Hua Bai 2024 年 4 月 2 日 13:44
I would like to specify a relative source code search path using Simulink S-function Builder App, however, there's only absolute path examples given on this documentation page: Build S-Functions Automatically Using S-Function Builder - MATLAB & Simulink (mathworks.com)
How can I specify a search path that's relative to
  • the current Simulink model path?
  • the current Simulink project path?

回答 (1 件)

Hua Bai
Hua Bai 2023 年 3 月 7 日
編集済み: Hua Bai 2024 年 4 月 2 日 13:44
I think we can set the environment variable in MATLAB and add ENV_PATH to s-function builder to do that.
Use the sfunction builder in the screenshot as the example,
0) set the environment variable in MATLAB command window
>> setenv("PROJROOT", 'path to your project');
1) add a "ENV_PATH" using the dropdown menu of "Insert Path" button which is located in the toolstrip
2) Set the value of new ENV_PATH to "$PROJROOT" in the bottom Libraries table

カテゴリ

Help Center および File ExchangeSimulink Environment Customization についてさらに検索

タグ

製品


リリース

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by