How to convert mxarray datatype in simulink
Ältere Kommentare anzeigen
I have to remove small objects from binary image and Im trying to use bwareaopen in simulink by using following code:
function y = fcn(u)
x = zeros(size(u));
coder.extrinsic('bwareaopen');
x = bwareaopen(u, 50);
y = double(x);
and getting error:
Class mismatch for variable 'bwareaopen'. Expected 'double', Actual 'logical'. Block MATLAB Function (#24) While executing: none
Model is as follows:

%
Akzeptierte Antwort
Weitere Antworten (1)
Kaustubha Govind
am 20 Mär. 2014
It looks like bwareaopen returns an output of type logical. You need to pre-declare 'x' as follows:
x = zeros(size(u), 'logical');
1 Kommentar
Nazim Badar
am 22 Mär. 2014
Bearbeitet: Nazim Badar
am 22 Mär. 2014
Kategorien
Mehr zu Computer Vision with Simulink finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
