How to read and write the same variable array during simulation?

조회 수: 5 (최근 30일)
Bill Silin
Bill Silin 2015년 11월 23일
답변: Chaitra Kulkarni 2015년 12월 2일
Hi all,
How can I read/write the same Workspace variable during simulation?
Options I tried:
1. DataStore block overwrites data and logging allows to read it only after the simulation.
2. FromWorkspace/ToWorkspace - again does not let me to read and write at the same time.
More specifically, I have a Simscape model of an aircraft. One of the navigation algorithms needs to look at N last records of GPS sensor. I can store them all and read AFTER the simulation. But I need to read last N and continuously update them DURING the simulation.
Thanks!
=Bill

답변 (1개)

Chaitra Kulkarni
Chaitra Kulkarni 2015년 12월 2일
You can use Data Store Read/Write blocks to read/write to a variable. Be sure to give the 'Write' operation higher priority than the 'Read' block. This will ensure memory is not read before it is written

카테고리

Help CenterFile Exchange에서 Data Logging에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by