Cell operations in eml
Afficher commentaires plus anciens
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 commentaire
Kaustubha Govind
le 23 Fév 2011
I don't know that cell-arrays are even allowed in Simulink.
Réponses (1)
Sulaymon Eshkabilov
le 20 Mai 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.

Catégories
En savoir plus sur String dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!