SimuLink: Implement Blocks with System Objects having multiple outputs.

5 visualizzazioni (ultimi 30 giorni)
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

Risposte (1)

Xianchao
Xianchao il 2 Lug 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

Categorie

Scopri di più su Create Large-Scale Model Components in Help Center e File Exchange

Prodotti

Community Treasure Hunt

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

Start Hunting!

Translated by