How to create/access and update global variables in Simulink using Data Store Memory block

5 ビュー (過去 30 日間)
In the Simulink Model (.slx attached), I would like to create a global variable 'Pulse' which I have attemped doing in the MATLAB function block. I further would like to update this variable such that at each iteration of the simulation, the updated variable is used by the MATLAB function block. I have added the Data Store Memory block to the model, however the model returns the following erroe for the above mentioned steps take:
Simulink cannot determine sizes and/or types of the outputs for block 'globalSimulinkData/MATLAB Function' due to errors in the block body, or limitations of the underlying analysis. The errors might be inaccurate. Fix the indicated errors, or explicitly specify sizes and/or types for all block outputs.
The variable 'Pulse' is initialised in the MATLAB script as 'PulseInit' (.m file attached).

採用された回答

Fangjun Jiang
Fangjun Jiang 2020 年 11 月 12 日

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSources についてさらに検索

タグ

製品


リリース

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by