How do I load a cell array from the workspace into a Simulink model?

10 views (last 30 days)
I'm having trouble being able to call upon a cell containing a lidar scan within each element inside of Simulink. I need to use the cell as an input to a Matlab function block which runs a script and picks lidar scans from the cell. In total there are over 2000 lidar scans but I don't think the number of scans should matter?
Also as an alternative to using a Simulink block to load the cell from the workspace I tried to load it into the script which I was running in the model. However, when I try to run the script in the function block, it comes up with errors for using the load function and not recognising the file even though I've tried the function in the command box and it works fine. The error comes up as the code below but in the Simulink diagnostic viewer.
Found unsupported class for variable using function 'load'.
Code generation does not support importing handle classes from MATLAB.
Use the command 'whos -file project_FSSGrid.mat' to view the variables in the MAT file.
Function 'CarMaker/CM_LAST/MATLAB Function' (#74.87.114), line 3, column 8:
"load('project_FSSGrid.mat')"
Launch diagnostic report.
Component:MATLAB Function | Category:Coder error
Does anyone have any other suggestions on how to call upon the cell variable for the script? Any help would be greatly appreciated!

Answers (1)

Leonard Classen
Leonard Classen on 5 Sep 2019
I am having the same problem.
I want to load a struct which contains symbolic expressions into a matlab function in a simulink model.
However, the Diagnostic viewer says: "Code generation does not support importing handle classes from MATLAB."

Categories

Find more on Simulink Functions in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!