lidarScan Error in Matlab function using Simulink

1 回表示 (過去 30 日間)
Uriel Jost
Uriel Jost 2018 年 3 月 20 日
Hello everybody,
I am using Matlab 2017b and try to use lidarScan in Simulink.
This is my Simulink Model
With its enabled Subsystem
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
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 件)

カテゴリ

Help Center および File ExchangeBiotech and Pharmaceutical についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by