One-time data import into Simulink
Afficher commentaires plus anciens
Hello there!
I am trying to import a 10001x5 matrix into Simulink, that contains weather data for different altitudes (each row represents an altitude). This dataset will be used as input to a dynamic model of an aircraft. The problem requires that, based on the current altitude of the aircraft the corresponding row of the dataset should be chosen in order to retrieve the data (wind speed, temperature etc.) for that particular altitude. The dynamic simulation does not have a fixed sample time (or simulation step fro that matter, I don't what the difference is at the moment) and for that reason I find it difficult to use the "From Workspace" etc. blocks that are typically used for such purposes. The best way to treat this kind of data, would be to execute a one-time import into the model workspace and retrieve the data needed based on the method described above. The data are saved as a .mat file using the save() function from matlab and are a product of another matlaba function, not included into the simulation.
Do you have any suggestions? Is there a better way to incorporate such a dataset into the simulation?
P.S. For the time being I am using the load() function inside a matlab function block, but this makes the simulation quite slow. I have also tried importing the data as a timeseries, either by using the corresponding blocks or via the model worskpace (inserting my own matlab script, directly importing the data as a structure). Any suggestions would be valuable!
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Event Functions dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!