Reading value from text file for every 10ms?

1 Ansicht (letzte 30 Tage)
Hemanth
Hemanth am 19 Jul. 2012
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 Kommentare
Albert Yam
Albert Yam am 19 Jul. 2012
I'm pretty sure you can't update a constant block when the model is running.
K E
K E am 20 Jul. 2012
This blog entry may be helpful.

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Miro
Miro am 19 Jul. 2012
Bearbeitet: Miro am 19 Jul. 2012
hi.
Use the following command
for i = 1 : xx
x = dlmread(filename, delimiter);
pause(0.001);
end

Kategorien

Mehr zu Modeling finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by