How to convert mxarray datatype in simulink
이전 댓글 표시
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:

%
채택된 답변
추가 답변 (1개)
Kaustubha Govind
2014년 3월 20일
It looks like bwareaopen returns an output of type logical. You need to pre-declare 'x' as follows:
x = zeros(size(u), 'logical');
댓글 수: 1
Nazim Badar
2014년 3월 22일
편집: Nazim Badar
2014년 3월 22일
카테고리
도움말 센터 및 File Exchange에서 Computer Vision with Simulink에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
