How specify simulink step time based on data array or time series
20 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Rasmus Melbye Kjeldmand
am 22 Sep. 2017
Kommentiert: Rasmus Melbye Kjeldmand
am 26 Mär. 2021
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?
0 Kommentare
Akzeptierte Antwort
Walter Roberson
am 25 Sep. 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 Kommentare
Sanjay
am 25 Mär. 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
Weitere Antworten (0)
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!