getting errors while Copying imported model from solidworks into a new simulink model
1 次查看(过去 30 天)
显示 更早的评论
I am trying to copy an imported Solidworks model into a new Simulink model, but I get these errors:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/168981/image.png)
my imported model is something like below and it works perfectly, but when i try to copy it in order to use it in another simulink model i get those errors mentioned above, what can i do?
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/168982/image.png)
Both my imported model and my new copied one are in the same folder and I am using R2017b version.
0 个评论
采纳的回答
Nicolas Schmit
2017-11-1
The model needs a variable "smiData" which is missing. Look for the code that imports or creates this variable.
1 个评论
Steve Miller
2018-3-6
When you export from SolidWorks, a MATLAB file is created that defines the data that Simscape Multibody needs. Usually, it is called name_DataFile.m That is where smiData is defined. When you import the XML file, the block diagram is created assembly_name.slx, and that MATLAB code is called from the Model Workspace. If you copy the blocks to a new model, that new model won't load the data into its workspace.
You need to either explicitly call name_DataFile.m so that the data is in the MATLAB Workspace or adjust your Model Workspace within the Model Explorer so that the data is loaded into the Model Workspace.
If this is not clear, look in the product documentation to learn what these terms mean. --Steve
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Applications 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!