Real-Time Interface between App in AppDesigner and Simulink using parsim - Error: not enough input arguments @(x)addlistener
Mostra commenti meno recenti
More questions to the topic.
Error using nhf>@(x)addlistener(x,'SimulationOutput','PostSimFcn',listener) (line 233)
Not enough input arguments.
in my simulink-modell i do the following. Is something wrong here?
Should i write listener = @nhf (Class)?

This function run in nhf (Class)
function Simulate(obj)
for simNr = numel(obj.Data):-1:1
in(simNr) = Simulink.SimulationInput(obj.simModel);
for prop = fieldnames(obj.Data(simNr))'
in(simNr) = in(simNr).setVariable(char(prop), obj.Data(simNr).(char(prop)));
% tbd: assign to baseworkspace
% assignin('base',char(prop), obj.Data(simNr).(char(prop)));
end
if isdeployed
in(simNr) = simulink.compiler.configureForDeployment(in(simNr));
end
end
% - Disable the automatic opening of the visualization viewer
% - Should be done for all models before compiling
% -------------------------------------------------------------
%open_system(obj.simModel);
%set_param(obj.simModel, 'SimMechanicsOpenEditorOnUpdate', 'off');
% Set up the listener for progress updates
listener = @(src,event) updateProgress(app,event);
% Save results internally
obj.simOut = parsim(in, ...
'ShowProgress','on',...
'TransferBaseWorkspaceVariables','on',...
'SetupFcn',@(x) addlistener(x, 'SimulationOutput', 'PostSimFcn', listener));
What is wrong in the function ('SetupFcn', @(x) addlistener(x, 'SimulationOutput', 'PostSimFcn', listener) ?
Is the function in simulink wrong?
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su Create Apps to Control Simulations in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!



