Use Matlab function inside Simulink MATLAB function

16 views (last 30 days)
I want to edit the point cloud data that the Simulation 3D Lidar block generates.
The data that is outputs I first need to convert into a pointcloud, similar is done with the helperGetPointCloud function that is used in multiple examples of working with the Simulation 3D Lidar block.
This function shows that it first creates a pointcloud from the data, so that is what i wanted to do first.
However when i tried that with this small function block in simulink:
function MultibeamPointCloud = Multibeamdata(PointClouddata)
MultibeamPointCloud = pointCloud(PointClouddata);
It will not work and i get the following error message:
Simulink does not have enough information to determine output sizes for this block. If you think the errors below are inaccurate, try specifying types for the block inputs and/or sizes for the block outputs.
Component:MATLAB Function | Category:Coder error
A top-level output parameter containing a class is not supported in MATLAB Function Block. Output parameter 'MultibeamPointCloud' contains a class. Function 'Subsystem/Create Multibeam data' (#264.9.28), line 1, column 10: "MultibeamPointCloud" Launch diagnostic report.
Component:MATLAB Function | Category:Coder error
Errors occurred during parsing of MATLAB function 'OwnSimulation/Subsystem/Create Multibeam data'
Component:MATLAB Function | Category:Coder error
Simulink cannot determine sizes and/or types of the outputs for block 'OwnSimulation/Subsystem/Create Multibeam data' due to errors in the block body, or limitations of the underlying analysis. The errors might be inaccurate. Fix the indicated errors, or explicitly specify sizes and/or types for all block outputs.
Component:MATLAB Function | Category:Coder error
I dont understand what this error means and how i can fix it, can anybody help me with this problem?

Accepted Answer

Prabhan Purwar
Prabhan Purwar on 24 Oct 2020
MATLAB Function block only support output such as scalar, vector and matrix. Output generated from pointCloud is a pointCloud object which requires class to handel in simulink.
Following example illustrates the pointCloud object support in Simulink:
For further insights kindly refer to the following links:

More Answers (0)

Community Treasure Hunt

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

Start Hunting!

Translated by