Setting Simulink Time Step from an external File

조회 수: 1 (최근 30일)
Saurabh Maithani
Saurabh Maithani 2013년 6월 4일
Hi guys
Is there a way to set the simulation time step in Simulink to match the time signals (variable sampling) present in an external file. So if this external file is loaded into the Matlab workspace and called 'Time', I can set the Simultaion start and stop time (under configuration parameters) to be Time(1) and Time(end), but how can i simulate my model at the exact same instances of time as present in the file 'Time'.
Thanks Saurabh

답변 (1개)

Azzi Abdelmalek
Azzi Abdelmalek 2013년 6월 4일
편집: Azzi Abdelmalek 2013년 6월 4일
set_param('untitled','Start Time','100')
set_param('untitled','Stop Time','1000')
  댓글 수: 2
Saurabh Maithani
Saurabh Maithani 2013년 6월 5일
편집: Saurabh Maithani 2013년 6월 5일
Thanks for the prompt response. I can set the start and stop time as desired from the script file but the real concern is running the simulink simulation at the exact instances of time which are present in the file 'Time'. 'Time' has non equal sampling.So lets say the column in Time has values 0.1 0.2 0.6 0.7 0.8 1.5 1.6... How do I get the Simulink simulation to simulate at each of these time values? The length of file 'Time' and length of the time vector (tout) generated by the simulink simulation should be the same.
Found the Solution: sim('Model Name',Time)
Thanks
Azzi Abdelmalek
Azzi Abdelmalek 2013년 6월 5일
sim('your_model',[0.1 0.2 0.6 0.7 0.8 1.5 1.6])

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

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by