필터 지우기
필터 지우기

to store data array while running a simulation in in real time.

조회 수: 5 (최근 30일)
Rohan
Rohan 2012년 5월 14일
Hello, in my simulink system i want to store incoming real time signal data in a data array for one iteration.I need to use this data in the next iteration.Is there some way to do that?
Just to be clear here is a brief description of my simulink model: 1)the whole system is iterative and iterates after every 25 seconds 2)I have a enabled subsystem in my model which runs for 0.2 seconds every iteration. I need to store the data at every sample time during this 0.2 second interval for some function in the next iteration. Any suggestions on how I can do this in simulink?

답변 (2개)

TAB
TAB 2012년 5월 15일
Have you tried Unit Delay block ?
[Edited 16 May,2012]
Try using Discrete/Tapped Delay block. It returns the multiple delayed value in an array. You can set the Number of delays property value of the block to 0.2/0.00025 = 800 as you need previous 800 samples.
  댓글 수: 2
Rohan
Rohan 2012년 5월 15일
The sample time of my system is 0.00025 seconds and I want an array of data of the samples stored in 0.2 seconds for the next iteration for some computation. Using unit delay we can store only the last sample value. I need to store (0.2/0.00025) samples every iteration. so i dont think unit delay will work.
TAB
TAB 2012년 5월 16일
Please see edited part of above answer.

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


K E
K E 2012년 5월 15일
At each time step, could you write out a mat file using the To File block containing the last 80 samples then at the next time step read in this file and perform your calculation? You would need to wait until you had at least 80 samples completed. I am not sure this will work, just a suggestion.
  댓글 수: 2
Rohan
Rohan 2012년 5월 15일
I am working on a real time environment using dSPACE. so during the simulation is running will the 'To File' and 'From File' blocks update in real time?
K E
K E 2012년 5월 15일
Sorry to say I don't know; hope someone answers who does.

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

카테고리

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