Zs.Zs.
Zs.Zs.

Reputation: 63

Simulink - From file block - Not defined time steps in .mat file (with examples)

I have file with a lot of data, for example here is a file with this data ->

time: 1 2 3 4 5 6 7 8 9 10
data: 1 0 1 1 1 1 1 0 1 0

but in my file I have dropped the multiple data going in sequence like this ->

time: 1 2 3 8 9 10
data: 1 0 1 0 1 0

If I run this data the result is this ->

http://img822.imageshack.us/img822/5047/v7nj.png

My question is how to achieve result like in this picture shown with red arrows. Simplier, how to repeat the value in not defined time steps (4,5,6,7 example above)

Upvotes: 1

Views: 618

Answers (2)

olusegun AO
olusegun AO

Reputation: 1

Try: Double-click the "From File" block, then go to the option "Data extrapolation within time range:", and select "Zero order hold"

Upvotes: 0

ben
ben

Reputation: 1390

you can achive this by not droping the final (7 in this example) like this:

time: 1 2 3 7 8 9 10
data: 1 0 1 1 0 1 0

this way simulink will interpolate ones there.

Upvotes: 3

Related Questions