Cell operations in eml

3 views (last 30 days)
tarek
tarek on 21 Feb 2011
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 Comment
Kaustubha Govind
Kaustubha Govind on 23 Feb 2011
I don't know that cell-arrays are even allowed in Simulink.

Sign in to comment.

Answers (1)

Sulaymon Eshkabilov
Sulaymon Eshkabilov on 20 May 2021
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.

Categories

Find more on Simulink Functions in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!