필터 지우기
필터 지우기

Simulink Counter

조회 수: 2 (최근 30일)
john
john 2012년 3월 16일
I was wondering if there was a way in which I could get the real simulation time from a simulink model which I can then put into a matlab function.
ie
if time >= 60s startTrain = 100; end;

답변 (2개)

Kaustubha Govind
Kaustubha Govind 2012년 3월 16일
Not exactly sure what you mean. Assuming that you intend to run the Simulink model, you will probably use the SIM command which only returns to MATLAB after simulation is complete. However, if you are click play on the model and want to query the status, you can use: get_param('modelname', 'SimulationStatus') - it returns "stopped" when the simulation is done.
There is no determinate way of predicting how long a simulation takes in real-time, because it depends on a variety of factors like system performance and Simulink solver settings.
  댓글 수: 1
john
john 2012년 3월 16일
I wish to use the clock in a user defined function, thus real 'running' time and not after the simulation has finished.

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


Guy Rouleau
Guy Rouleau 2012년 3월 16일
You say:
"I wish to use the clock in a user defined function"
What about using the "clock" function:
in a user defined function:
It can be the "Interpreted MATLAB Function", "MATLAB Function", or "Level-2 MATLAB S-Function".

카테고리

Help CenterFile Exchange에서 General Applications에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by