MATLAB: How to operate a variable in simulink

memory allcoatetivariable

Hi, I am using the Simulink with TI processors to design my application. In my application, i need a variable to store some information. I just find the Memory Allcoate block to specify the variable. But How i get and change the value of the variable specifiedby the Memory Allcoate block? Could anyone give me some solutions? or Is there any other to operate the variable? My matlab version:2009a,CCS version:3.3,DSP Processor: TMS320F2812
Best regards!

Best Answer

If you're using the Memory Allocate block, it appears that you need to use the Memory Copy block to read/write to it. But you can only exchange data between memory locations - ie., you cannot use a Simulink signal to read/write. If you just need a global variable, I would recommend using the Data Store Memory block with Data Store Read and Data Store Write blocks.