How to set and get value for a Data Store Memory.
Mostrar comentarios más antiguos
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 comentario
Patrick
el 5 de Mzo. de 2024
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Load Signal Data for Simulation en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!