필터 지우기
필터 지우기

SimuLink: Implement Blocks with System Objects having multiple outputs.

조회 수: 2 (최근 30일)
Jens Henrik Göbbert
Jens Henrik Göbbert 2014년 5월 5일
답변: Xianchao 2014년 7월 2일
Hi,
I would like to use User-Defined System Objects in SimuLink ( http://www.mathworks.de/de/help/simulink/matlab-system-block.html ) having eleven outputs. But when I add the block to a SimuLink model and try to compile it, I get the error message
"[..]error occurred when invoking 'isOutputFixedSizeImpl' method of 'sf.csvSource'. Too many output arguments."
I implement the protected function isOutputFixedSizeImpl() like this:
function varargout = isOutputFixedSizeImpl(~)
varargout = cell(1, getNumOutputs(obj));
for i = getNumOutputs(obj)
varargout{i} = true;
end
end
Any idea what I am doing wrong?
best, Jens Henrik

답변 (1개)

Xianchao
Xianchao 2014년 7월 2일
Hey Jens Henrik,
Did you forget to add 'obj' as input argument? Try this:
function varargout = isOutputFixedSizeImpl(obj)
% Get outputs fixed size.
varargout = cell(1, getNumOutputs(obj));
for i = 1:getNumOutputs(obj)
varargout{i} = true;
end
end
Best, Xianchao

카테고리

Help CenterFile Exchange에서 Create Large-Scale Model Components에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by