How to set and get value for a Data Store Memory.
Afficher commentaires plus anciens
Hello,
I would like to Read and Write in a Data Store Memory (DSM) with a Matlab function.
This matlab functions looks like :
- SetValue(GlobalVarName, NewValue)
- CurrentValue = GetValue(GlobalVarName)
The GlobalVarName shall be a string with the name of the DSM.
Currently, I have already created all my Simulink.Signal with the script, here an example:
- % Signal Vaux
- Vaux = Simulink.Signal;
- Vaux.Dimensions = 1;
- Vaux.Complexity = 'real';
- Vaux.DataType = 'double';
- Vaux.Description = '[Signal Vaux]; [Value = 0 to 20]; [Units = V]; ';
- Vaux.InitialValue = num2str(12);
In my Simulink Model, I use the block DSM Write in order to change the value Vaux.
I use a slider to change the value of a constant who are connected to my Vaux DSM.
But, now I would like to read a text file, with a set of value of Vaux, instead to use the slider.
I need to use the string name of the DSM to change its value because I have hundreds of values.
Can you help me?
Thanks.
1 commentaire
Patrick
le 5 Mar 2024
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Load Signal Data for Simulation 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!