How to specify relative code paths in S-function builder
조회 수: 19 (최근 30일)
이전 댓글 표시
When setting INC_PATH, etc. in the S-function builder, how do I specify that path relative to some path (preferably from the directory in which the model is stored).
Use case: The simulink model exists in a git repo that is clone by multiple users. The code in the S-function builder block depends on a fair bit of C code that is also in that repo (and hence at a known location relative to the model slx file). Forcing each user to go in and edit full paths for their machine is annoying to say the least.
댓글 수: 0
답변 (1개)
Les Beckham
2023년 8월 7일
Have you tried the suggestion in this answer?
댓글 수: 2
Hua Bai
2023년 10월 19일
편집: Hua Bai
2023년 10월 19일
Hi Brandon, did you set the environment variable before you use it?
For your example, I guess you missed the step of "setenv("PROJROOT", "path to your project root");".
One example which works on my side is attached, you need to run the following line in matlab command window before you build your s-function builder.
setenv("myProjPath", "path to the folder");
참고 항목
카테고리
Help Center 및 File Exchange에서 Target Computer Setup에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!