Initial Value of DataStoreMemory
显示 更早的评论
MATLAB 2015b question: I am trying to set the initial value of a DataStoreMemory block in my Simulink model. I have created a Simulink.Bus object named MY_BUS and a DataStoreMemory block of that type.
For the initial value struct, I did this at the command line:
MyInitValue = Simulink.Bus.createMATLABStruct('MY_BUS');
MyInitValue.field1 = <value1>;
MyInitValue.field2 = <value2>;
etc...
Since the I don't populate every single field of MyInitValue, I set Configuration_Parameters->Diagnostics->Underspecified_Initialization_Detection to 'Simplified'.
However, when I put 'MyInitValue' in the InitialValue field of the DataStoreMemory, an error message is generated:
Invalid setting in 'MyModel.MY_BUS_Data_Store_Memory' for parameter 'InitialValue'.
Is there something I am missing?
1 个评论
Shubham Srivastava
2016-8-1
Hi Kurt,
I tried setting the initial value of a DataStoreMemory block using the Simulink.Bus object of a demo model. To open the demo model, open it using
>> open_system('busdemo')
I then populate the value of Clock and Pulse fields, but leave the sine field unpopulated. After doing the steps you mentioned, I did not get the Invalid setting for parameter Initial Value error. If you share the details of your model and structure values, then it will help in understanding the issue.
-Shubham
回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Event Functions 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!