how do i change the data file's directory for a simscape model?
8 views (last 30 days)
Show older comments
I've created a simscape model from a solidworks model. As part of the process, it created me a DataFile.m with all the sizes for the model. If i try to move the file itself to a different directory, the model won't build. Anyone knows how can I change the directory the simscape model reads, from the simscape itself?
0 Comments
Answers (1)
Murali Karnam
on 29 Oct 2019
In a default setting, this file is generated with a static path. Once you generate the model, you can modify it by right-clicking anywhere in the model and:
Find Referenced Variables -> select your model in the left hand pane -> select the Model Workspace in the middle pane -> modity the file name which has the path also included in it.
I removed the path only kept the file name, and it worked for me even if the whole folder is moved to another location.
1 Comment
Mitchell Lee
on 21 Apr 2022
I did pretty much this and it worked.
Find referenced variables > Simulink root > ModelName > Model Workspace
On the right, browse for a new directory, change the directory and then you can copy and paste the files into the new directory. It might give you a warning about shadowing so once you see it working just delete the old directory
See Also
Categories
Find more on Simulink Environment Customization in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!