![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1761964/image.png)
Importing data for a Simulink example in MATLAB
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hello,
When I type 'power_microgrid' in the MATLAB command window and press enter, I access a Simulink example for a microgrid. Now, I want to know how I can add a dataset of energy consumption by a consumer and a dataset of energy generation by a solar panel to this example so that the simulation can be performed with my data.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1761624/image.png)
0 commentaires
Réponses (1)
Udit06
le 29 Août 2024
The above example is using a "PreLoadFcn" model callback as shown below:
load('solar_load_data_24h.mat')
The above MAT file contains four 1441x1 column vectors namely "HPD_1min", "HPT_1min", "SPD_1min", "SPT_1min" which are feeded into the model as input data.
You can see the above data being inputted into the model in the "power_microgrid>Scenario" subsystem as shown below:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1761964/image.png)
In order to use your data instead of the example data, you can replace the column vectors that are loaded into the workspace in the example by your data.
I hope this helps.
Voir également
Catégories
En savoir plus sur Solar Power dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!