How specify simulink step time based on data array or time series
18 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Rasmus Melbye Kjeldmand
le 22 Sep 2017
Commenté : Rasmus Melbye Kjeldmand
le 26 Mar 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 commentaires
Réponse acceptée
Walter Roberson
le 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 commentaires
Sanjay
le 25 Mar 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
Plus de réponses (0)
Voir également
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!