s function builder source generation location

조회 수: 7 (최근 30일)
Joshua Hendrix
Joshua Hendrix 2019년 3월 19일
답변: Joshua Hendrix 2019년 3월 24일
I've been using the s function builder for a project and due to a modular design, I currently have 3 wtih plans to expand that as more complicated code is created. The problem is that each s function builder generates source files in the current working directory as stated in the docs here. Each S function builder is generating several files so it clutters up my main directory. I don't mind the mex files being in the main directory and it appears the generated source is not needed after mex files are generated as I can delete them and the simulation will still run without them as long as I don't make changes to the s function builder block.
I've attempted to tell Simulink to generate these files somewhere else using the cache folder and the code generation folder config as described by Simulink.fileGenControl but it seems to ignore those directories entirely. Is there a way to tell the s function builder to generate these files somewhere else? Or, tell it to clean the files up once its done with them? I realize re-generating these can be time consuming but that is worth having a manageable root folder.

답변 (2개)

Krishna Zanwar
Krishna Zanwar 2019년 3월 22일
Hey Joshua,
You can cd to another directory and then use the s function builder so all the files are created there and then copy the files you want back to you main directory.

Joshua Hendrix
Joshua Hendrix 2019년 3월 24일
I attempted to do this and due to the paths to source being relative, it wont compile. The paths have to be relative since this gets passed around to other team members and the absolute path would be different for every person.

카테고리

Help CenterFile Exchange에서 Simulink Coder에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by