lidarScan Error in Matlab function using Simulink
2 views (last 30 days)
Show older comments
Hello everybody,
I am using Matlab 2017b and try to use lidarScan in Simulink.
This is my Simulink Model
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/171409/image.png)
With its enabled Subsystem
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/171410/image.png)
Here you can see my simple Matlab function in Simulink
function lidarscan=fcn(u)
lidarscan=lidarScan(u);
This are the settings of the Matlab function
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/171411/image.png)
And this is the error I get
Expected cart to be one of these types: single, double. Instead its type was struct.
Function 'Enabled Subsystem/MATLAB Function1' (#23.41.56), line 3, column 12:
"lidarScan(scan)"
Launch diagnostic report.
Component:MATLAB Function | Category:Coder error
Errors occurred during parsing of MATLAB function 'Enabled Subsystem/MATLAB Function1'
Component:MATLAB Function | Category:Coder error
Simulink cannot determine sizes and/or types of the outputs for block 'Enabled Subsystem/MATLAB Function1' 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
Simulink cannot determine sizes and/or types of the outputs for block 'Enabled Subsystem/MATLAB Function1' 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:Simulink | Category:Model error
Port width mismatch. Input 'scan' expects a signal of size 1. The signal received is of size [1x1].
Component:Simulink | Category:Model error
I don't understand why 'scan' is asked to be single or double? If I do the same just using Matlab, there is no error.
I hope you can help me.
0 Comments
Answers (0)
See Also
Categories
Find more on Biotech and Pharmaceutical 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!