Effacer les filtres
Effacer les filtres

SimuLink: Implement Blocks with System Objects having multiple outputs.

2 vues (au cours des 30 derniers jours)
Jens Henrik Göbbert
Jens Henrik Göbbert le 5 Mai 2014
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

Réponses (1)

Xianchao
Xianchao le 2 Juil 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

Catégories

En savoir plus sur Create Large-Scale Model Components dans Help Center et File Exchange

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by