How to set and get value for a Data Store Memory.
이전 댓글 표시
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.
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 String에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!