Filter löschen
Filter löschen

SimuLink: Implement Blocks with System Objects having multiple outputs.

2 Ansichten (letzte 30 Tage)
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

Antworten (1)

Xianchao
Xianchao am 2 Jul. 2014
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

Kategorien

Mehr zu Create Large-Scale Model Components finden Sie in Help Center und File Exchange

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by