How specify simulink step time based on data array or time series

20 次查看(过去 30 天)
I have some sets of data I would like to input to simulink. These data interval varies in time step size. Ex.
t = [0; 15e-3; 30.1e-3; 45.1e-3]
For each these times there is 2 datasets which each is a bus signal, ex.
data1 = [0 0 0 0 0 0 0;
2 3 4 2 4 2 5;
3 4 2 3 4 5 2;
2 4 2 3 2 4 2;]
data2 = [200 203 199 206 202 220 204;
201 190 194 202 208 222 201;
203 205 197 205 203 223 205;
199 208 198 210 206 224 202]
How do I tell simulink to use these step times maps the data to port in simulink? Do i run with fixed or variable step size or something else?

采纳的回答

Walter Roberson
Walter Roberson 2017-9-25
Create tdata1 = [t, data1] and tdata2 = [t, data2] . Use the From Workspace block to import tdata1 and tdata2 . When you import a numeric matrix, the time of the sample is taken from the first column of the matrix. Make sure that you set the Interpolation mode as appropriate for your situation.
  6 个评论
Sanjay
Sanjay 2021-3-25
Hello Rasmus, I am trying to simulate a model with logged timesteps and corresponding data in Simulink.
Did you get the work around to get the simulink to trigger simulation only at these pre-detemined timesteps?
Thanks,
Sanjay
Rasmus Melbye Kjeldmand
Hi
Sorry I cannot remember, but do not think I did.I toke another approach with pure matlab I guess.

请先登录,再进行评论。

更多回答(0 个)

标签

Community Treasure Hunt

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

Start Hunting!

Translated by