how can i give m-file output to simulink model as input

88 次查看(过去 30 天)
i am trying to link a m-file out put to a simulink model as input

回答(3 个)

Azzi Abdelmalek
Azzi Abdelmalek 2012-12-10
What do you mean by m-file output? If it's a constant variable use TAB's answer, If it's a signal, use from file block, else, explain it.
  1 个评论
Ajay Kumar
Ajay Kumar 2016-8-28
编辑:Ajay Kumar 2016-8-28
Hie Azzi, I have a problem I have a Matlab code for random road profile which is generated from an equation..with this code I'm able to generate random road profile but, I couldn't give it as an input road for half car Simulink suspension mode. here is the code:

请先登录,再进行评论。


TAB
TAB 2012-12-10
编辑:TAB 2012-12-10
  1. Save your m-file output to base workspace in a variable say MayVar.
  2. Put a constant block in simulink model and put value = MyVar.
  3. Simulate your model. Constant block will the value from base workspace and pass pass it to following blocks.

Muruganandham Subramanian
编辑:Muruganandham Subramanian 2012-12-10
Your question is already answered, First check and ask question..

类别

Help CenterFile Exchange 中查找有关 Programmatic Model Editing 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by