s function builder source generation location

8 次查看(过去 30 天)
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