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

20 visualizaciones (últimos 30 días)
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?

Respuesta aceptada

Walter Roberson
Walter Roberson el 25 de Sept. de 2017
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 comentarios
Sanjay
Sanjay el 25 de Mzo. de 2021
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
Rasmus Melbye Kjeldmand el 26 de Mzo. de 2021
Hi
Sorry I cannot remember, but do not think I did.I toke another approach with pure matlab I guess.

Iniciar sesión para comentar.

Más respuestas (0)

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by