Reading value from text file for every 10ms?

Hi I need to read a value from a text file for every 10millisec which is input to my model (i give this value to a constant block which is input to the model). When i first start the simulation i should read the first value, after 10ms constant block should be able to read the second value and so on. Can anyone guide me through this problem. The reason i need to wait 10millisec is that the file is updated for every 10ms from external source.

댓글 수: 3

Simulink?
Also is the file being updated and that is why you need to wait? Or could the entire file be read in at the same time as long as the values were delivered one at a time ?
Albert Yam
Albert Yam 2012년 7월 19일
I'm pretty sure you can't update a constant block when the model is running.
K E
K E 2012년 7월 20일
This blog entry may be helpful.

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

답변 (1개)

Miro
Miro 2012년 7월 19일
편집: Miro 2012년 7월 19일

0 개 추천

hi.
Use the following command
for i = 1 : xx
x = dlmread(filename, delimiter);
pause(0.001);
end

카테고리

도움말 센터File Exchange에서 Block Libraries에 대해 자세히 알아보기

태그

질문:

2012년 7월 19일

Community Treasure Hunt

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

Start Hunting!

Translated by