Use Matlab function inside Simulink MATLAB function

조회 수: 9 (최근 30일)
Bram Surewaard
Bram Surewaard 2020년 10월 13일
답변: Prabhan Purwar 2020년 10월 24일
Hey,
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);
end
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?

채택된 답변

Prabhan Purwar
Prabhan Purwar 2020년 10월 24일
Hi,
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:
Thanks

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Point Cloud Processing에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by