how to import mat file to simulink?

主宰稳场 提交于 2019-12-24 22:19:06

问题


I have a problem with .mat file and Simulink. I need to input data from .mat file to Simulink but not signals, i need to input variables in blocks. Block "From File" doesn't do any good for me since it only uses signals.

Is there any way for me to use Simulink Callbacks, PreLoadFcn or InitFcn? Or is there some other way to do this?


回答1:


You can specify MAT file as input for your model workspace data using Model explorer. Open model explorer from the view menu and then choose "model workspace". You will see option to specify different ways for getting data on the rightmost pane. Choose MAT-File in this. You will be able to reference to the variables from this MAT file in your model. You can find more info at http://www.mathworks.com/help/simulink/ug/the-model-explorer-working-with-workspace-variables.html.



来源:https://stackoverflow.com/questions/29209131/how-to-import-mat-file-to-simulink

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!