bwboundaries() C++ code Generation Error?

201 Views Asked by At

I have enabled dynamic memory allocation in Simulation Target>Advanced with default threshold as 0. Then I attempt to run this code:

B={{nan}};    %%Defining so that it can be set as size variable.
coder.varsize('B',[50 1]);   
B={B;bwboundaries(BW,'noholes')}  %%Not B{:}=bwboundaries() as multiple inputs are not allowed
Y=B{2}                         
boundary=Y{2}

This is the error message:

=== Simulation (Elapsed: 1:21 min) ===
    Error: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.
    Error:This assignment writes a 'cell' value into a 'double' type in element '{1}{1}'. Code generation does not support changing types through assignment. Check preceding assignments or input type specifications for type mismatches.
    
    Function 'Image Processing System/corner_detection' (#95.612.613), line 21, column 1:
    "B"
    Launch diagnostic report.
    Error:Errors occurred during parsing of MATLAB function 'flightControlSystem/Image Processing System/corner_detection'
    Error:Simulink cannot determine sizes and/or types of the outputs for block 'flightControlSystem/Image Processing System/corner_detection' 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.
    Error:Simulink cannot determine sizes and/or types of the outputs for block 'flightControlSystem/Image Processing System/corner_detection' 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.

How can I modify the code so it works?

0

There are 0 best solutions below