Using global variables in Embedded Matlab function in simulink
Show older comments
Hi,
I am using data store memory blocks in conjunction with global variables to use global variables in embedded matlab function in simulink. I have 4 global variables and therefore I have 4 data storage memory blocks in my simulink model. However, when I ran my simulation, the values of the global variables were not taken from the data storage block and instead I got a warning which says:
Warning: The block 'Embedded MATLAB Function' is reading from element 0 of the data store 'Data Store Memory' before any blocks have written to this memory in a minor time step at time 400.0
400 - is my simulation time.
I do not understand the reason why I am receiving this message and the reason for the values of the global variables not being updated from the data storage :(
It would be great if any of you could advice or suggest me on this.
Thanks
Accepted Answer
More Answers (1)
Fangjun Jiang
on 28 Sep 2011
0 votes
Those are just warnings. If you are sure that you don't write to the memory as often as you read it, you can disable the warning.
Go to Simulink model, select menu Simulation->Configuration Parameters...->Diagnostics->Data Validity, in the "Data Store Memory Block" section.
Categories
Find more on String in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!