How to convert mxarray datatype in simulink
Mostrar comentarios más antiguos
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:

%
Respuesta aceptada
Más respuestas (1)
Kaustubha Govind
el 20 de Mzo. de 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 comentario
Nazim Badar
el 22 de Mzo. de 2014
Editada: Nazim Badar
el 22 de Mzo. de 2014
Categorías
Más información sobre Computer Vision with Simulink en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
