How to export to workspace a 4D array?

3 ビュー (過去 30 日間)
Mariana
Mariana 2020 年 5 月 17 日
コメント済み: Ameer Hamza 2020 年 6 月 4 日
Basically the first function is generating values between a certain range. This values are indexes in order to have access to certain locations of the 4D array.
When writting mode is active, I save the value of 0.365 to the current location. At the end I would like to export the 4D array to workspace with all the stored values.
The 4D array has the following dimensions: [50 311 91 61] = 86318050 single values
However the array seems to be not able to be exported due to the size. I thought that changing it into single values will help but it seems to be too big.
Any ideas on how to fix this?

採用された回答

Ameer Hamza
Ameer Hamza 2020 年 5 月 17 日
Instead of using "To workspace" block, try using assignin(): https://www.mathworks.com/help/releases/R2020a/matlab/ref/assignin.html to directly save the values in the base workspace. For example, write the following line in your function
assignin('base', 'base_variable_name', array_filled)
  12 件のコメント
Mariana
Mariana 2020 年 6 月 3 日
I have added the variable of 400MB into the simulink workspace, but I am not able to compile the model. I have an error message that there is no heap space, any suugestion on how to solve this issue?

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

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

製品


リリース

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by