Cell operations in eml
3 views (last 30 days)
Show older comments
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
Answers (1)
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.
0 Comments
See Also
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!