I have some data that I want to go into a system at specific times

조회 수: 2 (최근 30일)
katherine keogh
katherine keogh 2021년 4월 13일
답변: Shubham Khatri 2021년 4월 28일
I have recieved some data I would like to go into my Simulink model at the required time stamps for example I have [1,2;2,5;3,6;4,9] Where the first coloumn is the time and the second column is the data. How do I make the data go into the system at the correct times, so at 1 seconds 2 goes into the model, at 2 seconds 5 goes into the model, 3 seconds 6 goes into the model and 4 seconds 9 goes into the model

답변 (1개)

Shubham Khatri
Shubham Khatri 2021년 4월 28일
Hello,
As per my understanding of the question, you can follow the steps mentioned below to do this. I have attached a Simulink file as a reference.
  1. Create 2 column vectors (one with time (t) and the other with data )
  2. In Simulink, add an input block
  3. Go to Modeling>Model Settings>Data Import/Export
  4. Check and tick the Input and set values to '[t,<variable_name>]
Now you can attach the input block to other blocks and the Simulink model will now accept inputs with each input corresponding to a particular time.
Hope it helps

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by