Cell operations in eml

I need to perform a cell operation in a MATLAB embedded function in simulink, but the problem is that EML do not support cell operation.
I can save the cell array in a .mat file, load it and use the cell array as a constant (in the constant block) but I still need to access the cell before I use it as an input for the embedded function. I've tried using the MATLAB function after the constant (ie: u{1}) but it does not work either.
So any help?

1 件のコメント

Kaustubha Govind
Kaustubha Govind 2011 年 2 月 23 日
I don't know that cell-arrays are even allowed in Simulink.

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

回答 (1 件)

Sulaymon Eshkabilov
Sulaymon Eshkabilov 2021 年 5 月 20 日

0 投票

Yes, it is absolutely possible to do it in Simulink.
E.g.:
U{1} = 15;
save('MYdata.mat', 'U')
..
load('MYdata.mat')
You can save (e.g.: save('MYdata.mat', 'U') ) the input constant (e.g.: U{1} = 15) in cell array in *.mat file and load it in MATLAB workspace (load MYdata.mat). Then you can recall it (e.g.: U) in Simulink's constant block using MATLAB's built in command in your constant block cell2mat(U) - see this screenshot.

カテゴリ

質問済み:

2011 年 2 月 21 日

回答済み:

2021 年 5 月 20 日

Community Treasure Hunt

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

Start Hunting!

Translated by