필터 지우기
필터 지우기

Simulink input output from m file

조회 수: 5 (최근 30일)
James
James 2011년 12월 29일
댓글: Long Pham Van 2019년 3월 27일
Given an input a=[1 2 3] in an m file.
how do I run simulink WITH THE INPUT? Please dont suggest using workspace.
the obvious way to run simulink is sim('model',..) but how do I insert my input? In fact, the depreciated method is exactly what I need..
[T,X,Y] =sim('model',Timespan, Options, UT)
where UT is a matrix of time and input, T, X,Y is output. This is just like a matlab function. If it is depreciated what is the equivalent way to do it? The new sim command has syntax
SimOut = sim('model', Parameters)
is there any way to place my input into parameters?
Thanks!

채택된 답변

Kaustubha Govind
Kaustubha Govind 2011년 12월 29일
I suppose you could use the Input parameters to specify inputs with the ExternalInput property. You might also want to set 'SrcWorkspace' to 'current' if you want Simulink to look for those input variables in the calling function's workspace.

추가 답변 (1개)

James
James 2011년 12월 30일
Thanks Kaustubha!
Your method leads me to the exact question at stack overflow:
A good explanation is found there for anyone who needs it.
  댓글 수: 1
Long Pham Van
Long Pham Van 2019년 3월 27일
Thank you very much!!! It's very usefull for me.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Simulink Environment Customization에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by